OAuth 2.0 getting access token issue on postman

Sreedhar M
Kilo Expert

I'm trying to generate the access/refresh tokens using postman.

I have given Get method and provided the instance url as https://xxxxxx.service-now.com/oauth_token.do and under headers section, provided all the required key value pairs, like client id, secret, username, password and grant type.

And when I hit Send button , getting the below error,

{

   "error_description": "access_denied",

   "error": "server_error"

}

please help me to get the tokens.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Sreedhar M 

I have written a blog for this

Please refer the same and do remember to mark it as helpful and also bookmark if that helps

OAuth 2.0 with Inbound REST

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

27 REPLIES 27

Hi,

So definitely issue with how you are try to generate the access token

please share postman screenshot on how the request looks like

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

find_real_file.pngfind_real_file.png

Oops, I was using key value pairs under Headers section, instead of Body, my bad. Now Postman working to generate the acces/refresh tokens. 🙂

Thanks Ankur for your valuable time. Let me mark your answer as correct.

Glad to help.

Please remember to mark appropriate responses as helpful as well.

I hope you must have marked my blog for OAuth as helpful and also bookmark it

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar  One last question, how can we automate getting access token for every 30minutes as it expires after 30 mins. This is required when we schedule alerts/notifications.