Instagram API: The access_token provided is invalid

AndrewR picture AndrewR · Jun 3, 2016 · Viewed 33.8k times · Source

I have registred a sandbox user. Now I am trying to use it, but I recieve "The access_token provided is invalid". Sample request:

https://api.instagram.com/v1/users/searchq=abc&count=2&client_id=7b67cff1a7ab462881298434c08b5ab8

It was working in live mode, but I can't find why it isn't working in sandbox.

Answer

MR Gharibeh picture MR Gharibeh · Jun 3, 2016

You need 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.

Good luck