I have a question for Facebook App Developers :)
Is it possible to like a comment created by some user on any fanpage, via access_token and post request?
I read from https://developers.facebook.com/docs/graph-api/reference/object/likes that it should be possible, however I can't find a way to figure out how to get an object ID of a comment.
Should I use in my fb.api request - postid_commentid as an object id?
Thanks in advance!
You guess it right. The comment_id that you obtained as postid_commentid cann be used as the {object-id}. So simply make the call-
\POST /comment_id/likes
and the comment will be liked.
PS. you can always test the API call in Graph API Explorer
Hope that helps!
Related
I need to read facebookk timeline and some tutorial says me to read with API Graph and I use:
https://graph.facebook.com/***/posts?access_token=***
but when I use this code I obtain {data[]} . I don' know how I wrong. Anyone can help me?
You question is pretty broad.
Did you use the Facebook API explorer? Found here
Are you sure the token is valid?
I am pretty sure what you are doing wrong is your call above is un-versioned so it will default to v2.0+. Which means you can't query based on user name. Next if you are using a user Id in the middle *** it will return empty because that user hasn't authorized the app that got the token, and/or has decided to hide themselves from open graph calls. You can use a public page ID in that spot to get that page posts.
Give this a try
https://graph.facebook.com/ME/posts?access_token=***
Provided you have a valid token it should work with unversioned calls. I suggest you play with the API explorer linked above.
i'm looking for a way to code some statistics for a facebook group which displays infos like most active member, most commented post and such.
i've tried to parse the group's email-notifications, unfortunately facebook doesn't notify on each event.
so i was thinking about curling directly from the facebook group.
is there a way to do this or is it possible through the facebook api?
thanks
I think your best bet is Facebook Grap API.
Check this Graph API - Group : http://developers.facebook.com/docs/reference/api/group/
Hope this help!
I have created an app, and now i want to post a message on one of my pages wall with use of the new Graph API. Is this do-able?
below is the steps which i do
Using this to Get access code
https://www.facebook.com/dialog/oauth?client_id=1498653617947&redirect_uri=https://apps.facebook.com/post_on__my_page/index2.html&scope=email,read_stream,publish_stream,manage_pages,offline_access
Than use this to get access token
https://graph.facebook.com/oauth/access_token?client_id=1498653617947&redirect_uri=https://apps.facebook.com/post_on__my_page/index2.html&client_secret=seceret&code=AQDCqJNJnCvnFKVdbCyTp2vfzbT0ADbNgYsQ_2YtDdC_O2aIOwvkjx52HNcp3uiuBANJqOhb_M2sptB-lRrIECZxi5kZpzljez1J1oOtTp25gTnNDmV-RCVvR97DMiRAprNtwUBcstAotjsyYo5cNwJCWnkcgNigwhbQtE5Jp22sluVcZKhnO43cWQE#_=_
Now get page id and page access token from below
https://graph.facebook.com/me/accounts/?access_token=the_access_token_above
*use this to post on my page *
https://graph.facebook.com/1916117518646/feed?message:testmessage&access_token=aceess_token
any one please explain which point is wrong because instead of posting is just show posts details
i found that some thing wrong in this below code any one please suggest what and how to do
https://graph.facebook.com/1916117518646/feed?message:testmessage&access_token=aceess_token
I always highly suggest to people experimenting around for the first time to use the Graph API Explorer tool. It helps solidify the structure of the Graph and how to access it. See https://developers.facebook.com/tools/explorer
Another thing I always recommend is to lint the access_token you are trying to use. See https://developers.facebook.com/tools/lint. This is to ensure you have the right token with the correct permissions.
Also the access_token you use to post to a page must be a page token and not a user token. In your above example, it's unclear as to which one you're using since you've named both the same. I know you said you're using it, but with that variable name being the same, I always wonder.
Also the you need to do an HTTP Post and not an HTTP get to post a message. Again, play around in the graph API explorer until you can do it there. Once you've done it there, it's fairly trivial to do it with one of the SDKs.
You need to perform POST request, not GET, and pass parameters in POST body, not in the url
http://developers.facebook.com/docs/reference/api/user/#posts
http://facebook.stackoverflow.com/questions/691425/how-do-you-post-to-the-wall-on-a-facebook-page-not-profile
I followed this tutorial: http://developers.facebook.com/docs/authentication/
on how to setup Facebook authentication using php (server-side implementation). I can get a access token back from Facebook but how do I get the Facebook user ID of the user who has logged in?
You should use facebook PHP SDK:
https://github.com/facebook/php-sdk/
See the example file in order not to get Lost...
https://github.com/facebook/php-sdk/blob/master/examples/example.php
Facebook graph API is kinda annoying... so using this will be easier (at least for me)
The easiest way, if your framework/sdk/whatever doesn't provide it for you, would be to query https://graph.facebook.com/me?fields=id&access_token=....
If you're looking for a quick non-programatic way of getting your user-id, it's in your browser cookie called c_user I believe
My problem is that I want to know the users that uninstall my facebook application. I have set a callback url for facebook to hit when someone uninstalls the app and all I get is a signed request POST variable which, according to facebook documentation should be a base64 json encoded object but it seems impossible to trace the user's facebook id in there. Actually it's more like random data.. :| Anybody knows how to parse this thing to get the fb uid?
I tried:
<?php
$data = json_decode(base64_decode($_POST['signed_request']));
?>
And still I don't get something valuable out of it..
Check this documentation on facebook: http://developers.facebook.com/docs/authentication/signed_request/
Especially the "Verifying and Decoding" section, where you will find code to decode your signed_request parameter.