Introduction
SuiteCloud (SuiteTalk REST Web Services) is now usually available for all NetSuite products, extending a robust set of complementary SuiteTalk SOAP web services that have been part of NetSuite’s core integration solution for several releases. Including REST web services in SuiteTalk provides administrators and developers with even more options for integrating NetSuite with environments, external applications, and data sources.
REST web services support API discoverability, offer link-based navigation, provide users with seamless access to NetSuite record metadata, and give users a uniform approach to interacting with both custom and standard records.
No server-side coding or management of custom codes is necessary, as is the case with server-side RESTlets used to extend SuiteScript APIs when building REST-based integrations.
This blog shows building REST-based integrations with OAuth 2.0 in your NetSuite Account, Postman Environment Setup, and POST Request.
REST Web Services Prerequisites and Setup
To use the REST web services, the relevant features must be enabled in your NetSuite account:
- Go to Setup > Company > click Enable features.
- Select SuiteCloud subtab.
- Check the REST Web Services feature in the SuiteTalk (Web Services) section.
- Check the OAuth 2.0 checkbox in the Manage Authentication section.
- Check the SuiteAnalytics Workbook in (Analytics) subtab.
- Click Save.
Explore more about 5 Questions to Ask When Integrating with NetSuite
Assign the required permissions to the User Role
- Go to Setup > Users/Roles > Manage Roles.
- Locate the role you want to modify. Click Edit or Customize link.
- On the Permissions subtab, click Setup.
- In the Permission list, select REST Web Services from the dropdown list.
- In the Level list, select Full. Click Add.
- In the Permission list under setup, select Log in using Access Tokens from the dropdown list.
- In the Level list, select Full. Click Add.
- Click Save.
User Handbook To Lead Successful Netsuite ERP Implementation
Discover everything you need to know about NetSuite pricing with our comprehensive user guide. Get started today!
Download Guide
Create Integration Records for Applications using OAuth 2.0
The following steps describe how to create an integration record:.
- Go to Setup > Integration > Integration Management > Manage Integrations > Click New.
- Enter a name for your application in the required Name field.
- Enter a description in the Description field, if desired.
- Select Enabled in the State field.
- Enter a note in the Note field, if desired.
- On the Authentication tab, check the appropriate boxes for your application.
- Check the Rest Web Services & RESTlets box.
- Enter the valid redirect URI for your application, on which the authorization code will be handled.
- For the demo, I will be using https://google.com/.
- Under OAuth 2.0, check Authorization Code Grant for OAuth 2.0 to work.
- Click Save.
Once you click on the Save button, the Client Credentials values are displayed on the page.
Note: For security reasons, this only appears once; make sure you note them.
NetSuite provides an account-specific domain containing the NetSuite account ID as part of the domain name to access REST web services or RESTlets. You can find the company URLs at Setup > Company > Company Information under the Company URLs subtab.
Optimize your NetSuite Integration Strategy!
Seeking to enhance your NetSuite REST Web Services with OAuth 2.0 using Postman? Let AlphaBOLD guide you through the customization process. Transform your integration approach.
Request a DemoSetting Up Postman Environment
A Postman environment is a set of variables you can use in Postman requests. Using a Postman environment, you can switch between various NetSuite accounts and between your test or production accounts. Using Postman environments, you can customize requests using variables so you can switch between different setups without changing your requests.
- Click the icon in the top menu of the Postman application.
2. A popup window opens. Click Add on Manage Environments window.
- Enter a self-descriptive name for your environment
- Enter your account ID(for example, 3604360)
- Enter the credentials you created,. Tthe value of the consumer key/ client idand consumer secret/ client secret.
- Add all the variables and values as above.
- Click Add.
Creating Postman Collections
You can create a new collection by clicking the + New button in the left sidebar, the New button > hit the Collection option displayed on it. A new window will pop up.
- Give your new collection a Name.
- Select Type OAuth 2.0 under the Authorization section.
- The following detail will be automatically added;, if not, follow the below steps:
- Under Configure new token
- Enter Self- descriptive Token Name.
- Enter Auth URL
- {{proto}}://{{account}}.app.{{nsdomain}}/app/login/oauth2/authorize.nl
- Enter Access Token URL
- {{proto}}://{{account}}.{{suitetalkapi}}.{{nsdomain}}/{{restservice}}/auth/oauth2/{{version}}/token
- Enter Scope (For REST Web Services enter rest_webservices & for RESTlets enter restlets).
- Click GET New Access Token.
- Login to your NetSuite account and click on the Continue button.
- On popup manage access tokens window.
- Click the Use Token button.
- Tokens will be automatically added under the current token.
- Click Create.
Ready to Experience a Seamless NetSuite Integration!
Partner with AlphaBOLD for customized NetSuite solutions tailored to your needs. We can supercharge your project workflows within a defined timeframe– Connect with us to learn more!
Request a DemoRESTlet POST Request
- After creating a new collection, click on Add requests to create your first request
{{proto}}://{{account}}. {{restletsapi}}.{{nsdomain}}/app/site/hosting/restlet.nl?script=<>&deploy=<>
- Add the RESTlet URL and enter the test body.
- Click Send.
- The success response will return 200 OK.
-
We have the correct status, created a record, and also found a record Id in response. This means we could get into NetSuite and access our account information through third-party applications. Hence, we were authorized using OAuth 2.0.
Summary & Mandatory Steps to Follow Are:
- REST Web Services Prerequisites and Setup
- Assign the required permissions to a user’s role
- Create Integration Record, obtain Client Id and Client Secret
- Get REST URL from Company Information
- Postman Environment and Collection Setup
- Add request and test Integration