无法让Instagram应用程序使用新的API策略和限制

时间:2015-12-23 07:14:33

标签: api instagram instagram-api

应用的想法

我正在开发一个webapp,它将显示带有特定标签的最新媒体。此标签用于发布大型建筑物中的最新信息。每分钟都会检查上传的媒体并将其添加到显示器中。

问题

我发现Instagram更新了他们的API政策并增加了一些限制。 Instagram应用程序需要在上市之前进行审核。问题是审查过程需要使用正在使用的功能的完整演示,但我不能在审查之前使其工作...

工作原理

我获得了一个访问令牌:

https://api.instagram.com/oauth/authorize/?client_id=xXxXx&redirect_uri=http://thewebapp.dev/&response_type=token

我获得了一个访问权限并尝试使用以下内容获取媒体:https://api.instagram.com/v1/tags/theTag/media/recent?&callback=window.feed.load&access_token=xXxXx&callback=jQuery183033466151752509177_1450854322095&_=1450854322117

我从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."}}

文档说什么?

它应该使用简单的https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=ACCESS_TOKEN

它应该适用于沙盒模式(我使用正确的帐户验证)

我真的无法弄清楚它为什么不起作用。有这方面经验的人吗?

1 个答案:

答案 0 :(得分:6)

我发现了问题。我必须在授权期间添加正确的范围。它应该是:

https://api.instagram.com/oauth/authorize/?client_id=xXxXx&redirect_uri=http://thewebapp.dev/&response_type=token&scope=public_content

请注意,沙盒模式仅返回沙箱用户发布的媒体。我认为新的API很糟糕,因为它不是开发人员友好的。