Creating an Inventory Management System
We have been encountering an “invalid_request” error during OAuth 2.0 authentication, and despite checking the configuration multiple times, the error persists.
- Error Description:
- We are consistently seeing an “invalid_request” error when attempting OAuth 2.0 authentication.
- Integration Settings:
CLIENT_ID = f5bff7ee775c6b011848588deb91c6cb32dcb8d527d94b7dcf6f145c9675a84b
CLIENT_SECRET = 3c1a0296adf9766d0e24e8f52b2e844b9fcbe49b0cfcdc8b766273fa09afe524
REDIRECT_URI = https://script.google.com/macros/s/AKfycbyEySKF0-fPK6OlIhqTona78gIP-nPpTHW5ckkqhA8_jXCiQPCg9A7W460Ex8hQOWDx/exec‘; // Google Apps Script의 Web App URI
TOKEN_URL = https://4513429.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/tokenattached: document
- Code Sample:
var CLIENT_ID = ‘f5bff7ee775c6b011848588deb91c6cb32dcb8d527d94b7dcf6f145c9675a84b’;
var CLIENT_SECRET = ‘3c1a0296adf9766d0e24e8f52b2e844b9fcbe49b0cfcdc8b766273fa09afe524’;
var REDIRECT_URI = ‘https://script.google.com/macros/s/AKfycbyEySKF0-fPK6OlIhqTona78gIP-nPpTHW5ckkqhA8_jXCiQPCg9A7W460Ex8hQOWDx/exec‘;
var TOKEN_URL = ‘https://4513429.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token‘;function authorize() {
var state = Math.random().toString(36).substring(7);
var url = ‘https://4513429.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/authorize‘ +
‘?response_type=code’ +
‘&client_id=’ + encodeURIComponent(CLIENT_ID)
‘&redirect_uri=’ + encodeURIComponent(REDIRECT_URI)
‘&scope=rest_webservices’ +
‘&state=’ + state;Logger.log(‘Please visit the following URL to complete the verification process: ‘ + url);
} - Role Permissions:
- Does the user role making the API requests have the necessary permissions for REST Web Services.



