- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 04:30 AM
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.
Solved! Go to Solution.
- 10,912 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 04:41 AM
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
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2020 07:28 AM
Hi,
I would recommend 2 approaches
1) schedule job to refresh token and access token
OR
2) invoke the access token everytime you invoke the API
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2020 02:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2020 04:12 AM
You are welcome.
I had faced some difficulty in generating/refreshing the token via scheduled job since the job would run with System user and the token had some issue during the API consumption.
Not much sure on that but some issue was there
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2020 05:21 AM
Somehow for me also schedule job not generating the access token, but job showing as ran.
I've another question, what happen when refresh token expires and we try invoking api? will this also generate refresh token or we should get the token through api again ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2020 05:29 AM
Hi,
yes when you invoke the API it would everytime generate fresh access token if previous access token already expired.
Not much sure on the refresh token as haven't checked it
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader