cancel
Showing results for 
Search instead for 
Did you mean: 

Setting up NetSuite OAuth 1.0 authentication

johnnys
New Contributor

Hi,

I am trying to mimic a REST Post request, done in Postman, to NetSuite. I am struggling to understand how to replicate the authentication method. In Postman, I can use the OAuth 1.0 authentication type and successfully send a request.

image

How would I setup the SnapLogic REST Post snap to mimic this? I tried to setup the REST OAuth 1.0 account, however, it is not setup the same way as Postman’s OAuth 1.0.

image .

Thank you.

7 REPLIES 7

johnnys
New Contributor

Quite honestly, I do not know which one my attempt falls under. Essentially, I am trying to send a suiteql query through https://xxxxx.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql with an OAuth 1.0 authentication method. I apologize if this does not answer your questions.

Thanks,

Johnny

robin
Former Employee

@johnnys this can be achieved with the REST Snap Pack and a Netsuite OAuth 2.0 account. I’ll write up instructions for this in the coming days.

robin
Former Employee

Netsuite + OAuth 2.0

@johnnys I created an Integration in Netsuite (Setup > Integration > Manage Integrations), enabled REST Web Services and Auth Code Grant under OAuth section and entered in the SnapLogic REST Callback URL (https://elastic.snaplogic.com/api/1/rest/admin/oauth2callback/rest). I copied the generated key and secret also - creation is the only time these are displayed:

image

You must also enable REST Web Services and OAuth 2.0 as Features (Setup > Company > Enable Features)

image

In the REST POST Snap, create an OAuth 2.0 account, enter in the key and secret you copied earlier as Client ID and Client Secret.

I enabled Header Authentication.

For “OAuth2 Endpoint” I used https://<ACCOUNT_ID>.app.netsuite.com/app/login/oauth2/authorize.nl as per the Netsuite documentation.

For “OAuth2 Token” I used https://<ACCOUNT_ID>.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token

Grant Type is authorization_code and the Auth Endpoing config table had a single entry scope whose value should match the Scope section from earlier (in my case that was restlets,rest_webservices,suite_analytics).

Authorizing the account was successful and returned an access token and expiration (consider enabling Auto-refresh token also)

image

Then in the REST POST configuration, I tried to replicate your use case (SuiteQL):

Service URL = https://<my-account-id>.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql
HTTP Entity = {"q":"SELECT 'Hello world!' AS Greeting FROM DUAL"} (taken from a SuiteQL tutorial)

image

Lastly, the SuiteQL API requires a request HTTP header Prefer. I used a value of transient which I was on the tutorial above:

image

After configuring the Snap to Validate & Execute, a validation run successfully returned the JSON response from the Netsuite SuiteQL API:

image