Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error from Instagram: The access_token provided does not match an approved application

This was working fine for many months and now it's just a blank space. I get the following error: Error from Instagram: The access_token provided does not match an approved application. How can I get a new access_token for an existing client??

like image 821
David Jacobson Avatar asked Feb 07 '23 21:02

David Jacobson


2 Answers

You need to check you application hasn't been put into sandbox by Instagram. They made big changes to their API on the 1st of June and if you had it submitted your app for review it will be put in sandbox mode and only sandbox users will be able to use it.

Even if you are not in sandbox mode you may need to get your users to reaurhorize your app due to new scopes being used to control access to everything other than basic user information.

Check Instagram Developer Docs for more information on the changes

like image 170
AndyRyan Avatar answered May 01 '23 09:05

AndyRyan


You need to check your Access token's Scope and asking for login permission where some new Scope had been added ex:public_content Added. Also don't forget to check for requirements Scope for API you are using and if it's need and Authentications "Valid access Token". where also had some changes.

  • basic - to read a user’s profile info and media
  • public_content to read any public profile info and media on a user’s behalf
  • follower_list to read the list of followers and followed-by users
  • comments - to post and delete comments on a user’s behalf
  • relationships - to follow and unfollow accounts on a user’s behalf
  • likes - to like and unlike media on a user’s behalf

And take look about **Sandbox API behavior of your application not life yet :**

API Behavior

The behavior of the API when you are in sandbox mode is the same as when your app is live, but comes with the following restrictions:

Data is restricted to sandbox users and the 20 most recent media from each sandbox user Reduced API rate limits The first point is important and it means that the API behaves as if the only users on Instagram were your sandbox users, and the only media ever posted were the last 20 for each of these users.

For example, if you query the /users/{user-id}/ endpoint and the {user-id} is a sandbox user, then you will get the normal API response; but if the {user-id} is not a sandbox user, you will get a APINotFound error.

As another example, let's consider an endpoint that returns a list of media: /tags/{tag-name}/media/recent. The response returned by this endpoint will contain only media with the given tag, as expected. But instead of returning media from any public Instagram user, it will return only media that belongs to your sandbox users, restricted to the last 20 for each user.

Good luck

like image 36
MR Gharibeh Avatar answered May 01 '23 08:05

MR Gharibeh