refresh_token for AEP API | Community
Skip to main content
Pradeep-Jaiswal
February 21, 2025
Question

refresh_token for AEP API

  • February 21, 2025
  • 2 replies
  • 1137 views

I have used postman to get Oath tokens, that expired after every 24hr. if we need to use refresh token to get new Oath token, how do we do that ?

 

https: // {{IMS}}/ims/token/v2 ? grant_type=client_credentials&client_id={{API_KEY}}&client_secret={{CLIENT_SECRET}}&scope={{SCOPES}}

 

I have tried including offline_access in the scope variable, but still it doesnt return any refresh token

2 replies

DavidRoss91
Community Advisor
Community Advisor
February 22, 2025

Hi @pradeep-jaiswal 

That is the same POST call I would make to retrieve a new token. Do you have your post script set as this below?

var data = JSON.parse(responseBody);

if (data.access_token) {
    pm.environment.set("ACCESS_TOKEN", data.access_token);
} else {
    console.log("Unable to acquire ACCESS_TOKEN from Adobe IMS to make further calls to Adobe I/O APIs.")
}
Pradeep-Jaiswal
February 22, 2025

I do the same thing when using postman, but refresh_token is not part of the response. it only has access_token and expiry. this page talks about refresh_token https://developer.adobe.com/developer-console/docs/guides/authentication/UserAuthentication/IMS/#fetching-access-tokens

DavidRoss91
Community Advisor
Community Advisor
February 22, 2025

Sorry @pradeep-jaiswal I’m not very familiar with this then I’m afraid. I do see here that the refresh token will not always be provided.

 

Once you have fetched the access tokens for a user you may also be provided a refresh token in the response. A refresh token is only presented when the offline_access scope is requested in the authorize step. Please note that not all APIs and Services support the offline_access scope for security reasons.

kautuk_sahni
Community Manager
Community Manager
March 7, 2025

@pradeep-jaiswal Did you find the suggestions helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!

Kautuk Sahni