How to set up a token based external REST API inte...
# ask-stanley-ai
m
How to set up a token based external REST API integration?
c
AI generated answer (using internal Slack threads):
To set up a token-based external REST API integration in NetSuite, follow these steps: 1. Enable Token-Based Authentication (TBA): Navigate to Setup > Company > Enable Features. Under the SuiteCloud tab, check the 'Token-Based Authentication' box in the 'Manage Authentication' section. 2. Create a Role for TBA: Go to Setup > Users/Roles > Manage Roles > New. Create a role with the necessary permissions for the integration. Assign this role to the user you want to use for TBA. 3. Create an Integration Record: Navigate to Setup > Integration > Manage Integrations > New. Fill in the necessary details and ensure that 'Token-Based Authentication' is checked. Save the record to get the Consumer Key and Consumer Secret. 4. Create an Access Token: Go to Setup > Users/Roles > Access Tokens > New. Select the application, user, and role for which you want to create the token. Save the record to get the Token ID and Token Secret. 5. Use the Keys and Tokens: Use the Consumer Key, Consumer Secret, Token ID, and Token Secret obtained from the above steps to authenticate your external application with NetSuite's REST API. Remember, NetSuite has changed the Signature Method to HMAC-SHA256, so ensure to use this method for signing your requests. Here is a sample error you might encounter if the permissions are not set correctly:
Copy code
{
  "error": {
    "code": "INSUFFICIENT_PERMISSION",
    "message": "You do not have privileges to view this page"
  }
}
If you encounter this error, double-check the permissions assigned to the role used for TBA. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831482
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828979552
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.825500488
Please provide your feedback on this answer.