Muhammed Mansoor
Muhammed Mansoor

Reputation: 25

Instagram api not working for some api calls like follows, followedby etc

I am using instagram api calls for retrieving various details like media, followers list, followed-by list etc... Even though the user has followers api returns, some times with

{"pagination": {}, "meta": {"code": 200}, "data": []}

and sometimes with

{"meta": {"error_type": "APINotAllowedError", "code": 400, "error_message": "you cannot view this resource"}}

https://api.instagram.com/v1/users/1334757492/?access_token=2301663158.7114bad.addf9ad5791945e3a89a7fb1c3fca31c

The above api works fine. Also the api for getting media.

https://api.instagram.com/v1/users/1334757492/followed-by?access_token=2301663158.7114bad.addf9ad5791945e3a89a7fb1c3fca31c

The above api not working. Also api for follows list and some other api's

Upvotes: 0

Views: 504

Answers (1)

IIM NUR DIANSYAH
IIM NUR DIANSYAH

Reputation: 432

you must authorize your access-token on every API scope. and run it on sandbox mode. if you want activate it (on your case, you must at least authorize public_content and follower_list scope), visit this link :

activate public_content : https://api.instagram.com/oauth/authorize/?client_id=[YOUR-CLIENT-ID]&redirect_uri=[YOURREDIRECT-URI]&response_type=token&scope=public_content

activate follower list : https://api.instagram.com/oauth/authorize/?client_id=[YOUR-CLIENT-ID]&redirect_uri=[YOUR-REDIRECT-URI]&response_type=token&scope=follower_list

reference : 1. https://www.instagram.com/developer/authorization/ 2. https://www.instagram.com/developer/sandbox/

Upvotes: 0

Related Questions