How to read incoming Facebook pages using the Graph API

Hi, I am developing a management system for Facebook pages.
At the end of the Facebook page, all Facebook pages will be changed to the time level and they will receive a message from users.
So I want to add to read incoming messages on Facebook page, but I can't find how to read it using the Graph API. (The "/ inbox" method does not work with the page access token.)
Please let me know how to do this if you know.

Thanks,
Ogawa

+3


source to share


2 answers


I suffered a lot to find the correct URL. This is a completely different url compared to the messaging post.

You can read the posts for the page by sending an HTTP GET request to http://graph.facebook.com/PAGE_ID/conversations with the page access token permission and read permission.

Surprisingly, you can also be responsible for page posts.



You can reply to the user's post by sending an HTTP POST to http://graph.facebook.com/CONVERSATION_ID/messages

Please note that the page can only reply to the user's post. He cannot initiate a private message with the user. In addition, a page can respond no more than twice to a user's message before the user responds.

Hope it helps.

+13


source


Api graph explite uses this script after user authentication, permission required

script permission:

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

      

0


source







All Articles