Jordan
Jordan

Reputation: 39

How to Refresh Outlook access_token?

Okay so I am getting Error invalid_token while creating contacts to Outlook I have read a lot of documentation but I couldn't able to resolve the issue

The Answers that I found but not working for me

I tried adding Scope offline_access to the login API. In that code value get refreshed and I am passing that refreshed code value to access_token API But I am getting same access_token

Also, I found that we can refresh access_token using refresh_token but in response, I am not getting any refresh_token.

So how would I refresh the access_token.

Upvotes: 0

Views: 151

Answers (1)

Jordan
Jordan

Reputation: 39

Ok SO We Have to Pass the Following Parameter while Calling oauth2/v2.0/authorize API

&scope=
openid 
profile
email 
offline_access  /*----This Is Important For Getting Refresh-Token--*/
contacts.readwrite

Then Using Refresh Token You Can Call Below API

https://login.microsoftonline.com/common/oauth2/v2.0/token

with Grant Type

"grant_type"=>"refresh_token",

Upvotes: 1

Related Questions