Facebook API: as photo

The Facebook API (REST), how do you like the photo? There is stream.addLike function, but you need post_id, and I don’t see a way to get the post_id of the photo (not like pid or object_id).

+4
source share
4 answers

Now you can love the photo using the Graph API, using POST for a similar connection in the photo. This did not work previously, but now (2011/09/16). Not sure exactly when it was fixed, but this one was too long after the Graph API appeared.

+2
source

First of all, you add the identifier of the uploaded image when you add it. eg

var client = new FacebookClient(Access_Token); JsonObject jsonResponse = client.Get("me/feed") as JsonObject; string feed_ID = string.Empty; foreach (var account in (JsonArray)jsonResponse["data"]) { feed_ID = (string)(((JsonObject)account)["id"]); goto Next; } Next: { }; 

let's say you have the id of your last snapshot with 12345123_5488224848 support now you want to update this picture. write the following code.

  var client2 = new FacebookClient(Access_Token); clientS.Post("12345123_5488224848/likes"); 

done. after that check the condition of the photo.

+1
source

I think the actual photo is classes as the same type of object on the wall, so how can you get the stream_id for the photo, these are comments attached to the photo you can set stream.addLink found http: // developers .facebook.com / docs / reference / rest / stream.addLike here

By receiving post_id using the photos.get method, you can set the adn comment like an object via stream.addLike.

Hope this helps you.

0
source
  var client = new FacebookClient(Access_Token); JsonObject jsonResponse = client.Get("me/feed") as JsonObject; string feed_ID = string.Empty; foreach (var account in (JsonArray)jsonResponse["data"]) { feed_ID = (string)(((JsonObject)account)["id"]); goto Next; } Next: { }; 
0
source

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


All Articles