How do I β€œlike” pages / urls with the Facebook SDK API?

I am using this code:

$facebook->api('/me/likes/', 'post', array('url' => 'http://www.google.com')); 

I get the following error:

 Fatal error: Uncaught OAuthException: (#200) App does not have permission to make this call thrown in 

Region (permissions):

 'scope' => 'publish_stream, email' 
+4
source share
2 answers

The only thing that can be programmed is facebook objects with a likes connection.

Taken from https://developers.facebook.com/docs/reference/api/ :

You can comment or like any object that has / comments or / likes the connection by posting at https://graph.facebook.com/OBJECT_ID/comments and https://graph.facebook.com/OBJECT_ID/likes


UPDATE:

The user object also has a connection of type like, but it is used to aggregate characters. for other objects, it is impossible to "please" the user. (fortunately, P)

Thanks to @Juicy Scripter for pointing this out ...

+4
source

From: https://developers.facebook.com/docs/reference/api/page/

To get a list of your favorite pages from a user, you need HTTP. Get /me/likes with a valid user access token with at least user_likes permission. There is no API method to add a page to a page you like or remove a page from your favorites.

0
source

Source: https://habr.com/ru/post/1390215/


All Articles