Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook PHP SDK Version 5.0.0 like a post

I am trying to like a Facebook post posted from an account. I have the oauth token of the account but i cant figure out how to like a post from my php code. I have a facebook app and also have the app id and app secret for my facebook app. I want to do this using the PHP SDK Version 5.0.0.

Can anyone please help with this or direct me to the some documentation apart from the one here - https://developers.facebook.com/docs/reference/php/5.0.0

Thanks

like image 311
Tushar Kale Avatar asked Aug 28 '26 21:08

Tushar Kale


1 Answers

Surprisingly enough the approach that i commented on Navin's answer worked just fine now.When i had tried it previously i had gotten a 'Url not recognised' error.

My code is as follows-

$test=array(); $like=$fb->post('/'.$post_id.'/likes',$test,$token);

In the $like variable i get an object of FacebookResponse with a status of success or failure.

like image 95
Tushar Kale Avatar answered Aug 30 '26 10:08

Tushar Kale



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!