Reputation: 640
Idea of the app
Im developing a webapp that is going to display the latest media with a specific tag. This tag is used to post whats going on in a large building. Every minute it will check for uploaded media and add them to the display.
The problem
I discovered that Instagram has updated their API policy and added some restrictions. The instagram app needs to be reviewed before it goes public. The problem is that the review process needs a full demo of the functionality being used but I cant get it work before being reviewed...
How it works
I getting an access token with:
https://api.instagram.com/oauth/authorize/?client_id=xXxXx&redirect_uri=http://thewebapp.dev/&response_type=token
Im getting an accesstoken and trying to get the media with: https://api.instagram.com/v1/tags/theTag/media/recent?&callback=window.feed.load&access_token=xXxXx&callback=jQuery183033466151752509177_1450854322095&_=1450854322117
Im getting this error from API:
{"meta":{"error_type":"OAuthPermissionsException","code":400,"error_message":"This request requires scope=public_content, but this access token is not authorized with this scope. The user must re-authorize your application with scope=public_content to be granted this permissions."}}
What does the docs say?
It should work with a simple https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=ACCESS_TOKEN
It should work with sandbox mode (I verify with right account)
I really cant figure out why it doesnt work. Anyone who has experience with this?
Upvotes: 4
Views: 6063
Reputation: 640
I found the problem. I have to add the right scope during the authorication. It should be:
https://api.instagram.com/oauth/authorize/?client_id=xXxXx&redirect_uri=http://thewebapp.dev/&response_type=token&scope=public_content
Please note that sandbox mode ONLY returns media that was published by the sandbox user. I think the new API sucks since its not developer friendly.
Upvotes: 6