Facebook API:获取共享帖子ID [英] Facebook API: Get Shared Post ID

查看:139
本文介绍了Facebook API:获取共享帖子ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用FB Graph API,是否可以检查帖子是否像这样共享? https://www.facebook.com/alexey.kosov/posts/10203624447732200

Using FB Graph API, is it possible to check if the post is shared like this one? https://www.facebook.com/alexey.kosov/posts/10203624447732200

以及如何获取原始帖子ID?

And how to get the original post id?

推荐答案

在您的URL中 https ://www.facebook.com/alexey.kosov/posts/10203624447732200 10203624447732200是您的公开帖子ID.使用API​​ v2.0 ,您可以获取带有边缘sharedposts的共享帖子:

In your URL https://www.facebook.com/alexey.kosov/posts/10203624447732200 the 10203624447732200 is your public post id. With the API v2.0 you can get the shared posts with the edge sharedposts: https://developers.facebook.com/docs/graph-api/reference/v2.0/object/sharedposts

根据v2.0上的文档:

According to the documentation on v2.0:

对于页面帖子,可以使用任何有效的访问令牌检索页面上的公开帖子.页面上的人员发帖,提及该页面的人员的发帖或目标页面帖子(例如,按语言或地理位置)可能需要用户或页面令牌. 具有read_streamuser_posts permission的其他任何帖子的用户访问令牌

For page posts, public posts by the page are retrievable with any valid access token. Posts by people on the page, posts by people which mention the page, or targeted page posts (by language or geography, for example) may require a user or page token. A user access token with read_stream or user_posts permission for any other posts

因此,您需要具有两个权限之一的令牌.

So you need a token with one of the two permissions.

我试图从您的帖子中检索共享: https://developers.facebook.com/tools/explorer/?method=GET&path=10203624447732200%2Fsharedposts&version=v2.0

I tried to retrieve the share from your post: https://developers.facebook.com/tools/explorer/?method=GET&path=10203624447732200%2Fsharedposts&version=v2.0

它返回了我{"data": []},但是在分享帖子后,我重复了通话,并且能够在结果中看到我刚刚分享的帖子.

And it returned me {"data": []}, however after I shared the post, I repeated the call and I was able to see the post that I just shared in the results.

现在,如果我使用刚刚共享的post_id,我将再次收到一个空结果.因此,您只能看到谁分享了该信息,但看不到别人分享的信息. 如果您将共享帖子视为树的节点,则只能看到具有post_id的节点下的子树上发生的事情.

Now, if I use the post_id that I just shared, I receive again an empty result. So you can see only see who shared the post but not if it was shared from somebody else. If you think of shared posts as nodes of a tree, you can only see what happens on the subtree under the node with the post_id that you have.

您还需要考虑到,您将无法检索您不可见的重新共享的帖子.即:如果我以只有我"的隐私分享您的帖子,或者如果我以朋友"的隐私分享您的帖子,而我们不是朋友,则您将无法看到它.

You also need to consider that you will not be able to retrieve the re-shared posts that are not visible to you. i.e.: if I share your post with privacy "Only me" or if I share it with privacy "Friends" and we are not friends you will not be able to see it.

这篇关于Facebook API:获取共享帖子ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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