Instagram - 沙盒中用户喜欢的媒体

Instagram - media liked by a user in Sandbox

在沙盒模式下查询 Instagram API 以获取与令牌相关的用户喜欢的媒体,我没有得到任何数据。当然,用户有权在 Sandbox 中使用 App。

获取:https://api.instagram.com/v1/users/self/media/liked?access_token=访问令牌 (实际上,ACCESS-TOKEN 部分在授权后被替换为真正的令牌。)

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

我是在沙盒模式下什么也得不到还是我错过了什么?

抱歉,我还没有达到 50 的声望,因此无法在您的问题下发表评论。但是,如果您还没有提交您的应用程序以供审核,那么您就没有 public_content 范围,如果您想要使用端点 https://api.instagram.com/v1/users/self/media/liked?access_token=ACCESS-TOKEN.

,则这是必需的

根据Instagram API Documentation

The OAuth 2.0 specification allows you to specify the scope of the access you are requesting from the user. All approved apps have basic access by default, but if you plan on asking for extended access such as reading public content, liking, commenting, or managing friendships, you will need to specify these scopes in your authorization request. Note that in order to use these extended permissions, you must first submit your app for review.

获得 public_content 的权限后,您应该可以从 Instagram 获取数据集。

你想出来了吗?我对#tags 也有同样的问题,只是在浏览器中弹出了这个。

https://api.instagram.com/oauth/authorize/?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=code&scope=public_content

主要因素是范围=public_content。

显然您需要更改大写部分,但这应该可以满足您的需求。

鉴于您处于沙盒模式并且只请求喜欢的媒体,我认为 Instagram 不需要应用程序批准?