I have a .net app that needs to call the Rest API ...
# ask-stanley-ai
s
I have a .net app that needs to call the Rest API customer endpoint. I have the integration record the m2m and am able to generate an access token but am always getting a 401 error when calling the rest api endpoint. I have rest webservices checked on the integration record and my role is admin, so not sure what to check next.
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems like you are facing a common issue with NetSuite's REST API. The 401 error usually indicates an issue with permissions or authentication. Here are a few things you can check: 1. Role Permissions: Ensure that your role has the necessary permissions to access the REST API. This includes the 'REST Web Services' permission and any other permissions related to the data you are trying to access. For example, if you are trying to access customer data, you would need the 'Lists > Customers' permission. 2. SuiteAnalytics Workbook: One of the threads mentioned that enabling the 'SuiteAnalytics Workbook' permission resolved their issue. Even if you are not using SuiteAnalytics, this permission seems to be necessary for accessing certain endpoints. 3. Token-Based Authentication: Make sure that you are correctly implementing token-based authentication. This includes generating the correct access token and including it in your API requests. 4. Login Audit Trail: If you are still facing issues, you can check the Login Audit Trail in NetSuite for more details about the error. This can be found under Setup > Users/Roles > User Management > View Login Audit Trail. Remember to double-check all your settings and try again. If the issue persists, you may need to review your .NET application's code to ensure it is correctly handling the API requests and responses. ****** 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.845520079
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.838623106
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836792
Please provide your feedback on this answer.
Thank you for your feedback