6 April, 2021

NetSuite REST Web Services/ RESTlets with OAuth 2.0 using Postman


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. 
Infographics show the REST Web Services feature in the SuiteTalk - NetSuite REST Web Services
  • Check the OAuth 2.0 checkbox in the Manage Authentication section. 
Infographics show the OAuth 2.0 checkbox in the Manage Authentication section - NetSuite REST Web Services
  • Check the SuiteAnalytics Workbook in (Analytics) subtab.  
Infographics show 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. 
Infographics show the Assign the required permissions to the User Role - NetSuite REST Web Services
Infographics show the User Guide for NetSuite Solutions

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. 
Infographics show the Create Integration Records for Applications using OAuth 2.0 - NetSuite REST Web Services

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. 

Infographics show the Client Credentials values are displayed - NetSuite REST Web Services

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.

Infographics show the REST web services or RESTlets - NetSuite REST Web Services

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 Demo

Setting 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. 

  1. Click the icon in the top menu of the Postman application. 
Infographics show the icon in the top menu of the Postman application

    2. A popup window opens. Click Add on Manage Environments window.

Infographics show the Click Add on Manage Environments window - NetSuite REST Web Services
  1. Enter a self-descriptive name for your environment 
  2. Enter your account ID(for example, 3604360) 
  3. Enter the credentials you created,. Tthe value of the consumer key/ client idand consumer secret/ client secret. 
  4. Add all the variables and values as above. 
  5. 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. 

Infographics show that how to Creating Postman Collections
  • 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 
Infographics show 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. 
Infographics show the GET New Access Token
  • Login to your NetSuite account and click on the Continue button. 
  • On popup manage access tokens window. 
Infographics show the 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 Demo

RESTlet 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=<> 

Infographics show the create your first request
  • Add the RESTlet URL and enter the test body. 
  • Click Send. 
  • The success response will return 200 OK. 
Infographics show the Add the RESTlet URL and enter the test body
  • 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 

Explore Recent Blog Posts


Related Posts

Receive Updates on Youtube
Copyright © 2024 AlphaBOLD | NetSuite Solution Provider | All Rights Reserved