Netsuite中向SupportCase关联PhoneCall失败问题求助
NetSuite REST API:PhoneCall关联SupportCase的400错误解决方法
问题场景
通过NetSuite REST API创建PhoneCall并关联至SupportCase时,返回400错误。请求详情如下:
请求地址:POST https://[CN].suitetalk.api.netsuite.com/services/rest/record/v1/phoneCall
请求体:
{ "title":"test", "message": "test call", "phone": "+3101234567", "supportcase": 555 }
返回错误:
{ "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1", "title": "Bad Request", "status": 400, "o:errorDetails": [ { "detail": "Error while accessing a resource. You have entered an Invalid Field Value 555 for the following field: supportcase.", "o:errorCode": "USER_ERROR" } ] }
已尝试直接传入SupportCase的internal ID和caseNumber,均无法解决问题。
解决方案
NetSuite REST API中,关联其他记录类型的字段(如supportcase)需要使用嵌套引用对象格式,而非直接传入ID或编号。正确的请求体应将supportcase字段定义为包含internalId的对象:
{ "title":"test", "message": "test call", "phone": "+3101234567", "supportcase": { "internalId": "555" } }
额外注意事项
- 确认
internalId对应的SupportCase确实存在,且状态为可关联状态(如未被删除、未归档)。 - 检查当前API授权的角色是否拥有访问该SupportCase及创建PhoneCall的权限,权限不足也可能触发"无效字段值"类错误。
内容的提问来源于stack exchange,提问作者Webdeveloper_Jelle
相关产品推荐
相关产品推荐

