0

I want to add a phonecall to one of my supportcases.
When I use the following request, I get an error.

POST https://[CN].suitetalk.api.netsuite.com/services/rest/record/v1/phoneCall

The body:

{
  "title":"test",
  "message": "test call",
  "phone": "+3101234567",
  "supportcase": 555
} 

The error:

{
    "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"
        }
    ]
}

The documentation isn't clear enough, does someone know what I should use as value for the supportCase property?
I tried the caseNumber and also the internal ID.
Documentation: https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2021.2/index.html#/definitions/phoneCall

Webdeveloper_Jelle
  • 2,868
  • 4
  • 29
  • 55

2 Answers2

0

supportCase is an object with its own definition - a 'nested property' if you will. Try:

{
    "title":"test",
    "message": "test call",
    "phone": "+3101234567",
    "supportcase": {
        "caseNumber": 555
    }
} 
Krypton
  • 4,394
  • 2
  • 9
  • 13
  • Then I get a similar but different error: `Invalid value for the resource or sub-resource field 'supportCase'. Provide a valid value.` – Webdeveloper_Jelle Jul 21 '23 at 14:23
  • OK, I haven't tested it - I was just looking at the documentation, but a different error is some kind of progress. The docs actually specify that `caseNumber` should be a `string`, so try `"casenumber": "555"` (assuming that '555' is a valid support case id in your account) – Krypton Jul 21 '23 at 16:03
  • There's also `id` which is the internal id, so maybe try that instead. – Krypton Jul 21 '23 at 16:39
  • if I try `id` or `caseNumber` I still get the same error. It feels like im close but still missing something. – Webdeveloper_Jelle Jul 24 '23 at 08:18
0

When I try to add the related company as well, it works.

{
  "title":"test 12",
  "message": "test note",
  "phone": "+31642937986",
  "supportCase": 555,
  "company": 12
} 

The property company has to be send too, also the supportCase should be linked to that company for it to work

I had to use both internal Id's

Webdeveloper_Jelle
  • 2,868
  • 4
  • 29
  • 55