Like posts over Facebook graph api

Posted by Sima on Stack Overflow See other posts from Stack Overflow or by Sima
Published on 2010-12-26T18:47:20Z Indexed on 2010/12/26 18:54 UTC
Read the original article Hit count: 274

HI! I have little problem with facebook PHP SDK..I want to like a post, or something else via facebook PHP SDK..I am doing this code, I think it should be right, but  apparently it's not working..The given error code is, the PHP SDK dont know this kind of POST request(the generated link is definitely alright). What I have seen on Facebook Developers page is about the same..There is an example of Curl command, and I the PHP SDK is doing this requests over Curl (propably).

$this->getFacebook()->api("/"+$id+"/likes", 'post'); This is what I am using in my code and it's not working(Facebook API Exception unsupported post request).

Maybe, I have bad syntax in my code, but, for example, when I want to post a status to my Profile, it's working..Another cause which confused me, was when I tried to fetch these data over Graph api(on the documentation page is written, I should use address like graph.facebook.com/POST_ID/likes)...

You can comment on or like a post by posting to https://graph.facebook.com/POST_ID/comments and https://graph.facebook.com/POST_ID/likes,respectively:

curl -F 'access_token=...' \ https://graph.facebook.com/313449204401/likes <=this is from facebook documentation

And all these requests or commands(liking ones, comments have I not yet tried) are putting me back a JSON array which contents any already existing likes, but my like is nowhere.

Does anyone know what to do?How to like a post from PHP..There are other SKDs like FQL, but I haven't any knowlegde with it, so I like rather to use the standard PHP SDK(but if is there some possibility how to call for example FQL from PHP SDK, here I am:))

Please help..

© Stack Overflow or respective owner

Related posts about php

Related posts about web-development