REST Web Services Request Processing

Besides synchronous execution, you can also execute requests asynchronously in REST web services.

Note:

REST requests have a size limit of 104MB.

The asynchronous execution of requests is useful for long-running requests. With asynchronous requests, you send a request to REST web services, where it is placed in a processing queue and handled asynchronously with other requests. Your client application does not wait for a response. After a job is submitted, a job ID is returned in the REST web services response. Your client application can then check the status and result of the request by referencing the job ID. Asynchronous processing can be useful if you expect your connection to NetSuite to be slow or unstable.

Asynchronous REST jobs are handled within REST Async Processors, according to the number of SuiteCloud Plus licenses. For information about SuiteCloud Plus, see SuiteCloud Plus Settings.

Note:

The processing of asynchronous REST calls does not affect the governance limits of asynchronous SuiteScript processes. The governance limits are calculated independently. However, extensive async REST usage can affect the overall performance so it may cause performance degradation in the running of scripts.

Asynchronous request execution also supports an idempotency retry mechanism, which allows you to handle a particular query through a unique key. Idempotent retry helps to avoid creating duplicate records, and it prevents the submission of the same task multiple times. It also helps you find loose-running jobs after a connection failure.

You can execute any REST request asynchronously by using the Prefer: respond-async request header. The response to the request contains the following HTTP header that you can use to retrieve the status of the request: Location: https://demo123.suitetalk.api.netsuite.com/services/rest/async/v1/job/<id>.

Related Topics

General Notices