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:
![]()
You must also enable REST Web Services and OAuth 2.0 as Features (Setup > Company > Enable Features)
![]()
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)
![]()
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)
![]()
Lastly, the SuiteQL API requires a request HTTP header Prefer
. I used a value of transient
which I was on the tutorial above:
![]()
After configuring the Snap to Validate & Execute, a validation run successfully returned the JSON response from the Netsuite SuiteQL API:
![]()