Tomohide Ogawa
Tomohide Ogawa

Reputation: 41

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

Upvotes: 4

Views: 22313

Answers (2)

user3308882
user3308882

Reputation: 21

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>';
?>

Upvotes: 0

Jeyara
Jeyara

Reputation: 2298

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.

Upvotes: 17

Related Questions