The DataCenterUrls REST Service

The DataCenterUrls REST service lets you obtain the correct URL for external client application access to NetSuite. When you build an integration between NetSuite and an external client application, you must incorporate logic that can determine the correct URL for the appropriate NetSuite account.

For details about dynamic discovery of URLs, see the following topics:

The DataCenterUrls REST service does not require authentication, making it ideal for integrations that use token-based authentication.

When you submit your request, you must provide your account ID as an input parameter so that the information returned will be specific to your account.

You can use the DataCenterUrls REST service to discover account-specific domains for the following:

These account-specific domains are unique to your account. The URLs do not contain a data center identifier, they contain your account ID. For more information, see URLs for Account-Specific Domains.

You can send a request for your production, sandbox, and Release Preview accounts. Ensure that you include the appropriate account ID in the request. The format is https://rest.netsuite.com/rest/datacenterurls?account= <accountID>, where <accountID> is a variable representing the account ID.

Sample REST DataCenterUrls Request and Response

In the following examples, the account ID, or c parameter, is 123456. Send your HTTP GET request in the following format: https://rest.netsuite.com/rest/datacenterurls?account=123456

Important:

If you receive a Service Unavailable error message, try including the c parameter (c=account id) in the request. Send the request in the following format: https://rest.netsuite.com/rest/datacenterurls?account=123456c=123456. Including the c parameter in your request ensures that the request is routed correctly according to your version and that you receive the correct response.

The following is an example of the complete text of the Service Unavailable error message:

Service Unavailable

No service is available at this URL. If you expect this service to be available for your account, ensure your account number appears in the URL as request parameter ā€œcā€.

Example: https://webservices.netsuite.com/services/NetSuitePort_X_X/c=123456

This service does not require an authorization or a content-type header.

When sending a correctly formed request, the response is returned in one of the following formats. The returned information should not be parsed to retrieve any additional information.

Examples of Returned Information

Environments where account-specific domains are used:

          {
"restDomain": https://<accountID>.restlets.api.netsuite.com 
"webservicesDomain": https://<accountID>.suitetalk.api.netsuite.com
"systemDomain": https://<accountID>.app.netsuite.com
} 

        

The full request and response can look as follows.

Request:

          GET /rest/datacenterurls?account=123456 HTTP/1.1
Host: <host> 

        

Response:

          HTTP/1.1 200 OK
Date: Thu, 22 Jun 2017 05:48:56 GMT
Content-Length: 179
Content-Type: application/json
 
{"webservicesDomain":"https://<accountID>.suitetalk.api.netsuite.com","restDomain":"https://<accountID>.restlets.api.netsuite.com","systemDomain":"https://<accountID>.app.netsuite.com"} 

        

REST DataCenterUrls Errors

If you send a GET request that contains a nonexistent account ID, you receive the default NetSuite domains in the response.

          {
"restDomain": "https://rest.netsuite.com",
"webservicesDomain": "https://webservices.netsuite.com",
"systemDomain": "https://system.netsuite.com"
} 

        

Additionally, you may receive the following errors.

Error

Description

USER_ERROR: You need to provide a proper value for the required field: account.

This error is returned if you send a GET request that does not include the account ID input parameter.

USER_ERROR: Company ID is invalid

This error is returned if the account ID in the request contains an invalid character, such as a space or a percent sign.

HTTP Error 405 ā€“ Method Not Allowed

The DataCenterUrls service accepts only the HTTP GET method. This error is returned if the request contains an unsupported HTTP method.

Related Topics

RESTlets vs. Other NetSuite Integration Options
Issue Token and Revoke Token REST Services for Token-based Authentication
Understanding NetSuite URLs
NetSuite IP Addresses
Understanding NetSuite URLs
URLs for Account-Specific Domains
Supported TLS Protocol and Cipher Suites
Secure HTTPS Outbound Communication and SSL Certificates
VPN Configuration for User Access to NetSuite
Traffic Health

General Notices