How to send POST request to Oauth2 token endpoint?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-27-2022 01:32 PM
Currently I'm trying to get an access token utilizing OAuth 2.0 using Postman. I'm following this guide here
Here is my request:
`https://myinstance.service-now.com/oauth_token.do`
My data is set to: form-data-urlencoded
{
grant_type: password,
client_id: id,
client_secret:secret,
username: username,
password:password
}
Except when I run this request, I get a 401 unauthorized response
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-27-2022 04:38 PM
Hi, testing in Postman I don't see an option to add the key:value pairs in the format you have above.
Otherwise using a body that is x-www-form-urlencoded with separate entries for each key:value,
the only possible issue I can see with your data is the existence of white space ' ' prefixing some values and suspect that this could be seen as part of the value string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-28-2022 09:52 AM
Appreciate your help Tony! Turns out it was my own fault and I was using the wrong user credentials and now I am able to access the endpoint.