Sending an Asynchronous Request

You can send a request similar to the following:

          POST https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/<id>?fields=companyName,email,entityStatus
 Prefer: respond-async 

        

The following is an example response. The job ID is displayed in the location response header.

          HTTP 202 Accepted
Preference-Applied: respond-async
Content-Type: application/json
Location: /services/rest/async/v1/job/123456 

        

Then you can send a request using the job ID in the response header to retrieve the status of the request that is in progress: GET https://demo123.suitetalk.api.netsuite.com/services/rest/async/v1/job/1.

The following is the response:

          {
    "links": [
        {
            "rel": "self",
            "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/async/v1/job/1"
        }
    ],
    "completed": false,
    "id": "1",
    "progress": "pending",
    "task": {
        "links": [
            {
                "rel": "self",
                "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/async/v1/job/1/task"
            }
        ]
    }
} 

        

Related Topics

General Notices