tags:

views:

239

answers:

1

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

A: 

I think that the actual photo is classes as the same type of entity os a wallpost, so asloon as you can aquire the stream_id for the photo, it the comments that are attached to the photo you can set stream.addLink found http://developers.facebook.com/docs/reference/rest/stream.addLike Here

By getting the post_id via the photos.get method you should be able to set a comment adn like the object via the stream.addLike.

Hope this helps you.

RobertPitt
You can't get the post_id from photos.get which is the whole problem, you can only attain the object_id and pid. And I don't see a way to go from those to post_id.
QuinnBaetz
Have you tried a cross table join using FQL Like so: SELECT pid, aid, owner, src, src_big, src_small, link, caption, created FROM photo WHERE pid IN (SELECT pid FROM photo_tag WHERE subject=<uid>) AND aid=<aid> AND pid IN (pid)
RobertPitt
That doesn't get the post_id. I found out that this is impossible unless you have a partnership with facebook :D
QuinnBaetz
Do you have a reference for that?
ajbeaven
I think when a user adds a photo the photo goes into the desired folder, and facebook auto creates a templatized stream for that image, so when you like an image your actually liking the generated stream item. not 100% sure but that's how I would develop it to keep the entities separate.
RobertPitt
I talked with someone who had a partnership with facebook, in person, no reference other than that
QuinnBaetz

related questions