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

查看:102
本文介绍了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.

我正在使用此URL:

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天全站免登陆