即使帖子是公开的,Facebook Graph API 也会返回“false" [英] Facebook Graph API returns 'false' even though post is public

查看:16
本文介绍了即使帖子是公开的,Facebook Graph API 也会返回“false"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,当通过 Graph API 访问时,大多数公开帖子似乎都返回false".

In my application, most public posts seem to return 'false' when accessed via the Graph API.

示例:https://graph.facebook.com/1543370206_2215254431220?access_token=XXXX

该帖子是公开可见的,但查询上述内容总是返回 false.

That post is publicly visible, yet querying the above always returns false.

根据 StackOverflow 上的类似问题,我尝试使用应用程序访问令牌和几个不同的 oAuth 2.0 用户访问令牌和 offline_access,但没有成功.

As per similar questions on StackOverflow, I've tried using both an application access token and several different oAuth 2.0 user access tokens with offline_access, but without success.

我也尝试使用 profileid_postid ID 格式(如上)和 postid 格式(https://graph.facebook.com/2215254431220?access_token=XXXX)访问它,但没有成功.

I've also tried accessing it using the profileid_postid ID format (as above) and postid format (https://graph.facebook.com/2215254431220?access_token=XXXX), but no luck.

我也在 24 小时后重试,只是为了确保我没有超过任何 API 限制.

I've also retried after 24 hours, just to be sure I'm not exceeding any API limits.

我已经测试了 1,000 多个公开帖子(我知道它们是公开的,因为我使用搜索方法从 Graph API 获取它们,但我还在浏览器中进行了一些随机抽样以确保).75% 返回 false(无论我使用的是应用程序访问令牌还是用户访问令牌).

I have tested more than 1,000 public posts (I know they're public because I obtained them from the Graph API using the search method, but I've also done some random sampling in a browser to be sure). 75% returned false (regardless of whether I used an application access token or a user access token).

推荐答案

我想我已经解决了.

返回 false 的帖子本身并不是公开的".他们似乎对任何 Facebook 用户可见,无论他们是否与作者是朋友.但是,如果您未登录 Facebook,则无法看到它们.

The posts which were returning false aren't 'public' as such. They seem to be visible to any Facebook user, regardless of whether they're friends with the author. However, if you're not logged into Facebook, you can't see them.

成功的帖子是真正公开的.其中大部分属于公司等,无论您是否登录 Facebook,您都可以看到它们.

The posts which were succeeding were truly public. Most of them belonged to companies etc and you could see them whether you were logged into Facebook or not.

我猜 Graph API 区分了这两种类型的可见性,例如Facebook 上的每个人"和互联网上的每个人".我查看了我的隐私设置,但无法弄清楚这是如何完成的.

I guess the Graph API makes a distinction between these two types of visibilities e.g. 'Everyone on Facebook' and 'Everyone on the Internet'. I had a look in my privacy settings and can't figure out how this has been done.

无论如何,Graph API 文档中并未对此进行详细记录.返回 '​​false' 也不是处理此错误的优雅方式.允许我通过搜索查看帖子但不直接查询对象也不一致.

Regardless, this isn't well-documented in the Graph API docs. Nor is returning 'false' an elegant way to handle this error. Nor is it consistent to allow me to see the post via search, but not query the object directly.

这篇关于即使帖子是公开的,Facebook Graph API 也会返回“false"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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