How to use NetSuite API Secrets in SuiteScript?

I created a secret in Setup > Company > Preferences > API Secrets with script ID custsecretprod_sftp_key.
In SuiteScript, I’m using it like this:
'Authorization': 'Bearer {{secret:custsecretprod_sftp_key}}'

What should I store in the password field of the secret?

  • NetSuite password?
  • Access token from OAuth 2.0 client credentials?
  • Client ID/Secret?
  • Token ID/Secret (TBA)?

I tried using NetSuite password or access token, but got "Invalid login attempt". What’s the correct approach to call NetSuite REST API using secrets?

Posted Jun 3, 2025, 7:35 AM UTC

16
Loading comments…