Netsuite RESTlets connection
Setting up the connection
- Make sure you are logged in as an Administrator.
- Enable web services & token-based authentication
Enable web services & token-based authentication
- Under Setup > Company > Enable Features.
- Click SuiteCloud.
- Under SuiteTalk, enable SOAP WEB SERVICES.
- Under Manage Authentication, enable TOKEN-BASED AUTHENTICATION.
- Scroll to the end or start of the page and click Save.
Create an integration record (app) for Data Integration
-
Under Setup > Integration > Manage Integrations > New.
-
Name your integration Data Integration.
-
Make sure the TOKEN-BASED AUTHENTICATION (TBA) is enabled, and insert the callback URL based on the site you log in to Data Integration. For US URI:
For accounts using https://console.rivery.io:
https://console.rivery.io/api/oauthcallback/netsuite_restlets
For accounts using https://eu-west-1.console.rivery.io:
https://eu-west-1.console.rivery.io/api/oauthcallback/netsuite_restlets
- Click Save. A consumer secret and key appear. (Also, they will only appear once).
Create a role and set permission
-
Create a role
- Go to Setup > Users/Roles > Manage Roles > New.
- Name your role Data Integration.
- Under Authentication enable the WEB SERVICES ONLY ROLE option.
-
Set Permission for the role
There are two options when setting permissions: -
Set the administrator role:
This is done under the General tab > issue role > administrator. If you choose this option, continue to the "Create a user..." section once the role is set (don't forget to save the role) -
Set specific permission for the role:
A list of minimum permissions you need to grant to the role to use Data Integration with Netsuite:
-8097c84fbf7d7846dae1e13cbcf1b51d.png)
Add permissions
- Under the permissions tab, find the subtab corresponding to the entity you wish to extract. For example, lists.
- Find the record to which you want to add permission. For example, Accounts.
- Set the level of permission for that record. For example, view.
- Click add.
- Keep going until you add all entities.
- Click Save.
- You must also add specific permission for each record you want to use Data Integration to extract, For example, Accounts, Invoice.
Create a user and assign the role
Create a user and assign the role you previously created to the user. It is recommended to use "Data Integration" as the name of the user and the role.
- Go to Lists > Employees > Employees > New.
- Enter the name and the email address.
- Click the Access subtab.
- Check Give Access and Send Notification Email.
- Check Manually Assign or Change Password.
- Assign a password of your choice.
- Select the Role that you need to assign. In this case, Data Integration and click Add.
- Click Save to save the record.
Create an access token for Data Integration
-
Under Setup > Users/Roles > Access Tokens > New.
-
Select the application (an integrated record) you've previously created.
-
Select the user you've previously created.
-
Select the role you've created for that user.
-
Enter a name for the access token or use the generated name.
-
Copy the token ID and secret; you need them in the connection in Data Integration. (Also, they will only appear once.)
Locate your account ID
- Navigate to: Setup > Integration > Soap Web Services Preference.
- Under Primary Information, you will find your Account ID.
Upload and deploy Data Integration script
- Download the javascript file from our repository press right-click on the link here and select Save link as. Otherwise, go into the link and download the raw file there.
(To download the file from GitHub, right-click on Raw, and select Save link as..)
-
Log in to your Netsuite account.
-
Go to Customization > Scripting > Scripts > New.
-
Select a new file (+) and upload the downloaded file. Write a suitable name for your script. Once finished, click Save.
-
Go to Customization > Scripting > Scripts.
-
After selecting the js file, click Create Script Record. In the Script title window opening up, click Save and Deploy.
-
In the Script Deployment screen opening up, check that the same permissions and status are selected:
- Select specific roles (or all) to run the script, status: released and Deployed.
- Once finished, click Save.
-
Copy the account ID, script ID, and deploy ID.
Sandbox account IDs end with -sb2, while production account IDs do not have this suffix. If your sandbox account ID includes an underscore (e.g., 123456_sb2) or any other character, please update it to use a hyphen instead (e.g., 123456-sb2).
Creating a NetSuite RESTlets connection in Data Integration
Procedure
- Navigate to your Data Integration account.
- Click Connections and select + New Connection.
- Choose NetSuite RESTlets.
- Enter a Connection Name and insert the connection details you located/created into the corresponding fields:
- Consumer Key
- Consumer Secret
- Token ID
- Token Secret
- Account ID - The located Account ID
- Script ID
- Deploy ID
- Click Save and create the connection.
- Click Test Connection to verify the test is successful.
If the test succeeds, you are ready to work with NetSuite RESTlets in Data Integration
If the test-connection fails, check the credentials. If you are certain that these steps are right, then the script's filename does not end with .js. Click edit script filename and add the .js.