本文介绍了“喜欢”一个使用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 Graph API的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-10 23:14