Dear all, I have a couple of questions regarding ...
# general
l
Dear all, I have a couple of questions regarding Netsuite's OAuth2 for REST Webservices • We are able to get an access_token and refresh_token via the OAuth2 flow 1. We are not able to refresh an access token (we always receive
invalid_request
):
Copy code
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=refresh_token&refresh_token=XXXX&client_id=XXX&client_secret=XXXX" <https://REDACTED-sb1.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token>
{"error":"invalid_request"}
2. Is it possible to fetch invoice documents (like an invoice pdf) via the REST API? 3. How to refresh a refresh_token? It seems to expire after 7 days? 4. In our "normal" OAuth applications we can use 1 integration/application that we register as a company. We can use the same
client_id
and
client_secret
and the same authorization + token urls for ALL our clients, it seems this is not possible for Netsuite? Thank you very much in advance.
look at the important section for where to put the client id and client secret
The same page also says what to do after the refresh token expires, which is basically start over from step 1
you will have to complete the authorization flow for each account, using a slightly different url for each one
l
The same page also says what to do after the refresh token expires, which is basically start over from step 1
I couldn't imagine someone would implement it that way. This means all clients should manually reconnect again.
b
you are not wrong there, its not very useful for integrations
l
Thanks for the help @battk I'll try to refresh a token with the Basic auth authorization header now. I've never seen this done this way before.
l
@battk Do you perhaps also know if Token Based Authentication requires a manual refresh?
Would this be a better solution for us maybe?
b
tba does not require refreshing
l
I'll give that a try then, thanks so much.
Are you familiar with the REST API too? Is it possible to download Invoice PDF or Invoice Attachments via the REST API?
b
i wouldnt expect so from the api browser, nothing file like in there.
you might be able to do something suiteql related to do a query on files
l
I'll check that out, thanks again