I'm integrating NetSuite Rest web services, and have troubles with OAuth2
I'm getting the code for requesting the token, but post url everytimes returns "invalid_grant". Why?
Redirect url is the same as saved in integration record, code is gotten from redirection url, and the grant_type is set to authorization_code.
Using Basic Authorization type with client id and client secret
What's wrong there?
Thanks for posting this to the community, @merisahakyan. I’ve also opened a ticket (#87331) so Support can review your connection and assist with the error message.
@merisahakyan you can't really use NetSuite's Oauth 2 for this exact reason. The access token you get after initially authenticating only lasts for 60 minutes and the refresh token only lasts for 7 days. After the 7 days, you would be required to reauth the connection. Having to do this makes it non ideal to use Oauth 2 for integrations. Instead of Oauth 2, you should use Oauth 1 TBA and here is an article on how to set it up: https://docs.celigo.com/hc/en-us/articles/14349054963995-Set-up-an-OAuth-1-0-connection-to-NetSuite-SuiteTalk-APIs-including-SuiteQL-
Docs discussing refresh token 7 day limit on Oauth 2: