Facebook subscription API - facebook-graph-api

When making a POST to subscribe to Facebook, Facebook issues a GET with the callback URL with the following query parameter:
hub.mode
hub.challenge
hub.verify_token
Once we verify the mode and the token and return the hub.challenge does Facebook respond with a status message? It is not clear in the docs...

You are correct it is not clear in the documentation. What happens on your end when you subscribe? If you get something viable, then click the Report Documentation Bug at the bottom of https://developers.facebook.com/docs/reference/api/realtime/ and log the issue.

Related

How to submit facebook app for review

We’ve created successful a bot and also can test with page token generated from facebook developer portal (the token must contain page_messagaging permission to be able to send reply message).
But when we submit to facebook to review, it seems they use real account to test and the token doesn’t contain page_messaging permission. (log from our server says: {“error”:{“message”:”Unsupported post request. Object with ID ‘me’ does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api”,”type”:”GraphMethodException”,”code”:100,”fbtrace_id”:”DPdtxdcTKaf”}})
The submission has been rejected 3 times now.
And have no solution now.
Anyone experience in this? Could you please help us resolve?
Really appreciate!

Posting a link to Facebook Page

I have a user who can manage some Facebook Page. I've got access token with all permissions, including publish_actions as written here.
When I send a POST request from Graph API Explorer to <page-id>/feed specifying message and access_token of course, my post appears in Page Feed and author of this post is Page. But when I send a POST request with link instead of message it appears in 'recent publications from others' with my name.
What have I done wrong?
I'm seeing the same thing. If I send a message to <page-id>/feed it will work fine. But if I send a link to the same endpoint it posts on the

How to read inbox of Facebook pages using Graph API

Hi I'm developing management system for Facebook pages.
All Facebook pages are changed to sytle of timeline by the end of March, they will come to receive message from users.
So I want to add to read inbox of Facebook page, but I can't find how to read it by Graph API. ("/inbox" method is not worked with page access token.)
Please let me know how to do if you know.
Thanks,
Ogawa
I have suffered alot to find the correct url. It is totally different url compare to Profile messaging.
You can read the messages for a page by issuing an HTTP GET request to http://graph.facebook.com/PAGE_ID/conversations with a Page Access Token and read_mailbox permission.
Surprisingly you can reply for page messages also.
You can reply to a user's message by issuing an HTTP POST to http://graph.facebook.com/CONVERSATION_ID/messages
Note that a page can only reply to a user's message. It cannot initiate a private message with a user. Also, a page can respond not more than twice to a user's message before the user has replied back.
Hope that helps.
Graph api explore use this script after authenticating user, permission required
permission script:
$loginUrl = $facebook->getLoginUrl(array(
'scope'=>'email,read_mailbox,read_requests',
));
READ INBOX:
<?php
$user_mail=$facebook->api('/me?fields=id,name,inbox.limit(10)');
echo'<pre>',print_r($user_mail),'</pre>';
?>

Facebook API Graph - posting a status update to a Facebook Page

I am following the Facebook developer documentation for making a post to a Facebook 'Page' as the Page itself, which according to the docs requires impersonation. I've gotten the access token for the page itself, as well as the Page's ID, by making a call to the "accounts" feed for the user who's the admin for the Page. I then POST to
https://graph.facebook.com/[Page_ID]/feed
With the post items
access_token
and
message
containing the access token and the message, and I get a JSON string back with a post ID. Which all seems to indicate that it is posting the message to the page. HOWEVER, when I go to the particular Page, it doesn't display the posted status.
Does anyone perhaps have any idea why that might be?
Thanks in advance everyone!
Did you make sure to get the "publish_stream" permission from the user?
http://developers.facebook.com/docs/authentication/permissions

How to handle the scenario "access_token changes when user changes facebook password"

I am able to see from the following link that, if password change, access_token will get invalidated.
http://developers.facebook.com/docs/authentication/
So, how to identify when user change his/her password.
I did not see anything about this in the graph api documentation.
Please help me regarding this.
Thanks,
Gopal.
When access_token is invalidated due to password change, you can no longer make Graph API calls, i.e. Graph API returns an error. You can recognize this error and set a flag in user profile which triggers a notification "Hi Gopal, you have to reconnect your account with FB. To do so, click [here]", where [here] points to the regular FB oauth url (i.e. https://graph.facebook.com/oauth/authorize).
EDIT 14/05/2011: Facebook just released blog entry on this topic: http://developers.facebook.com/blog/post/500