Instagram API 没有为沙盒用户找到任何喜欢的帖子 [英] Instagram API doesn’t find any liked posts for sandbox users

查看:29
本文介绍了Instagram API 没有为沙盒用户找到任何喜欢的帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在沙盒模式下使用 Instagram API.我正在尝试使用经过身份验证的访问令牌从 Instagram API 访问用户喜欢的帖子.此用户是我的应用接受的沙盒用户之一,并且喜欢了一些帖子.

I’m using the Instagram API in sandbox mode. I’m trying to access a User’s liked posts from the Instagram API using their authenticated access token. This user is one of the accepted sandbox users for my app, and has liked some posts.

如果我用相同的令牌调用其他端点,我会得到一些数据,但访问 /users/self/media/liked 返回空数据.

If I call other endpoints with the same token, I get some data, but accessing /users/self/media/liked returns empty data.

我正在使用这个网址:

https://api.instagram.com/v1/users/self/media/liked?access_token={verified access token}

这是我收到的结果:

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

因为它有一个 200 的返回码,所以访问令牌是有效的.那么为什么我看不到任何喜欢的帖子?

Because it has a 200 return code, the access token is valid. So why don’t I see any liked posts?

推荐答案

当您的应用在沙盒模式下运行时,与正常行为相比,它会受到限制.特别是(引用自沙盒的 API 文档):

When your app behaves in sandbox mode, it’s restricted compared to normal behaviour. In particular (quoting from the API docs for the sandbox):

该 API 的行为就像 Instagram 上的唯一用户是您的沙盒用户,并且发布的唯一媒体是这些用户中的每一个的最后 20 个.

The API behaves as if the only users on Instagram were your sandbox users, and the only media ever posted were the last 20 for each of these users.

因此,如果用户喜欢的帖子是由非沙盒用户发布的,则 API 无法看到这些帖子.

So the API can’t see posts that the user has liked if those posts were made by non-sandbox users.

这是一个场景:

假设:

  1. 假设全世界有 100 个 instagram 用户(我知道更多,只是为了举例!).
  2. 名为 APP1 的应用已上线且未处于沙盒模式.
  3. 名为 APP2 的应用处于沙盒模式[意味着尚未上线!].
  4. APP2 有 5 个经过验证和注册的沙盒用户.
  1. Say there are 100 instagram users all over the world(I know its more, just for example's sake!).
  2. An app named APP1 is live and not in sandbox mode.
  3. An app named APP2 is in sandbox mode[meaning not live yet!].
  4. There are 5 verified and registered sandbox users for APP2.

现在,正如 Instagram 文档所说:这是黑盒流程.

Now, as Instagram document has said: Here will be the black box flow.

情况 1:: APP1 尝试接受用户对沙盒/非沙盒用户的喜欢 - 结果:它获取他们的数据.原因:对于直播应用,该应用可见的用户数是 instagram 上可用的用户数.

Situation 1:: APP1 tries to accept user likes for sandbox/non-sandbox users - Result: it gets their data. Reason: For live apps, number of users visible to the app is the the number of users available on instagram.

情况 2:: APP2 尝试接受用户喜欢:对于沙盒用户 - 它将仅获取用户注册为该应用的沙盒用户的那些数据(喜欢这里).非沙盒用户的任何其他喜欢在这里将不可见.{好像有5个用户,如果有用户喜欢这5个用户的任何内容,都会被看到.}对于非沙盒用户 - 用户不可见!

Situation 2:: APP2 tries to accept user likes: For sandbox user - It will get only those data(likes here) for which the users are registered as sandbox users for this app. Any other likes for non-sandbox users will be not visible here. {As if 5 users existed, if any users like any content of those 5 users, it will be visible.} For non-sandbox users - Users are not visible!

我错过了可见性的最后一部分,我花了一些研究和相互关系来找出答案.我想可能还有其他开发人员可能不了解沙箱用户的文档可见性部分.

I missed the last part of visibility, which took me some research and co-relation to find out. I guess there might me other developers who might have not understood the sandbox user's visibility part of the document.

这篇关于Instagram API 没有为沙盒用户找到任何喜欢的帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆