How to get instagram access token according to latest instagram api rules?

Viewed 348

I followed that official document - https://developers.facebook.com/docs/instagram-basic-display-api/getting-started/

i get "code" using this link -

https://api.instagram.com/oauth/authorize?client_id={app-id}&redirect_uri={redirect-uri}&scope=user_profile,user_media&response_type=code

i get code successfully.

i get access_token using commands

curl -X POST \
  https://api.instagram.com/oauth/access_token \
  -F client_id={app-id} \
  -F client_secret={app-secret} \
  -F grant_type=authorization_code \
  -F redirect_uri={redirect-uri} \
  -F code={code}

Get results like this -

{
  "access_token": "IGQVJ...",
  "user_id": 17841405793187218
}

When i am using this access_token in my website then getting this error -

**Error from Instagram: The access_token provided is invalid.**
0 Answers
Related