Search code examples
drupaldrupal-7instagraminstagram-api

New Instagram API: empty data on /tags/TAGNAME/media/recent


i wrote a module for Drupal 7 with instagram images flow (based on a configuration of a hastag). Given the Client application registered on developers site and redirect urls configured correctly i managed to get the Access_token and finally got to use it on my front-end. But the problem is that API returns me empty data!

I've read that there're new rules and policies after November, 17 2015 for applications that are ALL now require access_token to make ANY type of request on Instagram API. More info here

  • I did Explicit authorization (server-side) flow.

  • Yes i did specified the scopes during the Authorization cycle (basic + public_content)

Call: https://api.instagram.com/v1/tags/TAG_NAME/media/recent?access_token=ACCESS_TOKEN

giving me the result: HTTP Status: 200

{
  meta: { code: 200 }
  data: {
    media_count: 1466
    name: "TAG_NAME"
  }
}

Why ?

Thx for help if any1 sees this.


Solution

  • Are you in Sandbox mode?

    If so:

    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

    Meaning, if your sandbox user(s) have no images with that tag, the data won't be shown.