Hello all, I'm trying to hit the `Issue Token` via...
# suitescript
d
Hello all, I'm trying to hit the
Issue Token
via Postman. Seems I'll need to figure out the pre-request functions to do so. Checking here to see if anyone might have done this already?
b
d
Ya. In reality @battk... I'm trying to educate myself on a programmatic way to get an access token from NetSuite
Round and round I go ... I'm only getting '400' responses
So, I've not even gotten to the front door yet!
b
its pretty much all hard coded parameters
unless you have the unfortunate task of generating a totp
d
I'd like to see an 'unauthenticated' response first .. just to let me know I've made progress.
b
that looks about right
gives the correct response too
now add the authorization header
d
Wait .. I get a different response in POSTMAN than I do in the browser
Maybe a USER-AGENT issue?
b
sounds weird, what headers are you sending
d
Authorization, User-Agent
Ya, why would postman response be different than the browser.
b
message has been deleted
d
When I remove my NLAuth, ya .. you're right
So, NLAuth is the issue then.
WHen I add the NLAuth back ... I get the ol'
Could not deteremine customer compid
b
im not sure how badly you have to mess up the NLAUTH to cause that error
d
Got it ... so, I have to ensure the nlauth_account is CAPITAL ...
Good lord
Now I have to over come the 2FA
b
i personally never had to do that
its probably easier to use a generator app
programmatically i suspect will involve converting a npm totp package
d
Ok, so 2FA is solved.
Last hurdle ... I get a
Not enough permissions
error.
I'm asking for a token ... so, the role I'm using has
Access Token Management
,
Log in using Access Tokens
and
User Access Tokens
Not sure what else I could add
b
Should only need User Access Tokens
id double check that your employee actually has access to the role you are trying to use
d
It sure does .. cause its me!
WINNING!
Got it .. thanks for listening to me @battk