Mighty
Mighty

Reputation: 387

Instagram Feed : Error validating access token: Session has expired

My Instagram Feed is not loading.

For GET : https://graph.instagram.com/me/media?fields=media_url,caption,permalink,media_type,thumbnail_url&limit=6&access_token=XXXXXXXXXX

It is giving me below error

{
   "error": {
      "message": "Error validating access token: Session has expired on Saturday, 18-Jul-20 20:02:04 PDT. The current time is Tuesday, 21-Jul-20 18:45:28 PDT.",
      "type": "OAuthException",
      "code": 190,
      "fbtrace_id": "XXXXXXXX"
   }
}

How to solve this?

Upvotes: 1

Views: 2172

Answers (1)

Hamza Kamal
Hamza Kamal

Reputation: 9

Make sure your access token is not expired. To test it out, generate a new token and then use that token curl -X GET \ 'https://graph.instagram.com/{user-id}?fields=id,username&access_token={access-token}' and replace user-id with your instagram-id and access-token with the token generated for you.

Here is an example from Official docs. curl -X GET \ 'https://graph.instagram.com/17841405793187218?fields=id,username&access_token=IGQVJ...'

If it works for you, then you can implement it with any http client. And if the same error happens, then please make sure to test it with a newly generated token.

Upvotes: 1

Related Questions