“喜欢”一个使用Facebook Graph API的页面

问题描述:

使用Graph API,我希望能够让一个授权用户像一个页面。

Using the Graph API I'd like to be able to have an authorized user "like" a page.

我尝试发布以下

https://graph.facebook.com / $ {PAGE_ID} / likes?access_token = $ {ACCESS_TOKEN}

我收到一个HTTP错误500,伴随着无效的post_id参数在JSON响应体中。看起来像 /喜欢资源适合喜欢墙上的帖子而不是页面。如何让它与页面一起使用?

And I get an HTTP error 500 accompanied by "Invalid post_id parameter" in the JSON response body. Looks like the /likes resource is suited to liking a wall post and not a page. How do I get this to work with a page?

Facebook已经通过使用官方的内置喜欢动作。您需要具有 publish_actions 权限。图表网址为:
https://graph.facebook.com/ [用户FB ID] /og.likes?object=OG_OBJECT_URL&access_token=USER_ACCESS_TOKEN

Facebook has announced support for liking URL's outside of Facebook by using the official built-in Like action. You need to have publish_actions permissions. The graph url for this is: https://graph.facebook.com/[User FB ID]/og.likes?object=OG_OBJECT_URL&access_token=USER_ACCESS_TOKEN

但是,您目前无法使用它来像Facebook上的一个页面,因为文档状态

However, you cannot use this to like a page on Facebook currently, as the documentation states:


对于Facebook页面或网站不要与Facebook整合
认证,开发人员应该继续使用Like按钮
社交插件。

For Facebook Pages or websites that do not integrate with Facebook Authentication, developers should continue to use the Like button social plugin.