Facebook API Like a Page with Auth Token
I've got a Facebook oauth token and I'm trying to Like a page for a user who has given me permission to do so. Assuming 123456789 is the id of the Facebook page the user wants to Like, I post to this page and g开发者_JAVA百科et the following error:
https://graph.facebook.com/123456789/likes?access_token=...
{
"error":{
"type":"OAuthException",
"message":"(#3) Application does not have the capability to make this API call."
}
}
This page of the Facebook documentation (https://developers.facebook.com/docs/reference/api/) says:
You can comment on or like any object that has a /comments or /likes connection by posting to https://graph.facebook.com/OBJECT_ID/comments and https://graph.facebook.com/OBJECT_ID/likes, respectively
The user wants to Like a Facebook Page and the Page documentation (https://developers.facebook.com/docs/reference/api/page/) shows that it does have a /likes connection, so it should be Like'able via the api... but it's not working. Any ideas?
Currently this is only possible with the old (and DEPRECATED) REST API. Using the method "pages.addFan". Though this method is not visible in Facebook's API Documentation. So I assume that this is also possible somehow with the new Graph API, because their Facebook mobile apps will need to move on to their new APIs soon, and they make use of the Page Like function.
What's really weird, is that their brand new iPad app, is based on the old REST API! Interesting...
精彩评论