简体   繁体   English

FB API-从页面邮箱中提取未读邮件的数量

[英]FB api - pull number of unread message from page's mailbox

I'm trying to pull the 'unread' messages from our Facebook Page (as opposed to an individual user's page. I'm trying to use FQL to pull the data; 我试图从我们的Facebook页面(而不是单个用户页面)中提取“未读”消息。我试图使用FQL提取数据;

SELECT folder_id, viewer_id, name, unread_count, total_count 
FROM mailbox_folder 
WHERE folder_id = '0' and viewer_id = '$pageID'

$pageID is the ID of the page. $ pageID是页面的ID。

I have manage_pages permissions on the user's account, and that account is an administrator for the page. 我对用户帐户具有manage_pages权限,并且该帐户是页面的管理员。 Since it is a new feature from facebook to allow messages direct to pages, I am wondering if it's not yet possible to obtain this information via FQL. 由于它是Facebook的一项新功能,允许将消息直接定向到页面,因此我想知道是否尚无法通过FQL获得此信息。

I get an error message which says; 我收到一条错误消息,内容为:

(#606) You can only fetch messages for one user (#606)您只能为一个用户提取消息

When I look up for permissions (manage pages, publish stream and read_mailbox) for the page, as opposed to the user, the following is returned; 当我查找该页面(而不是用户)的权限(管理页面,发布流和read_mailbox)时,将返回以下内容;

 "manage_pages": 0,
 "publish_stream": 1,
 "read_mailbox": 0

I don't know I can request the read_mailbox permission from the page as oppose to the user. 我不知道我是否可以从页面上向用户请求read_mailbox权限。 Does anyone have any idea how I might achieve the above? 有谁知道我将如何实现上述目标?

See this document which shows how to obtain a page access token - https://developers.facebook.com/docs/authentication/pages/ 请参阅本文档,其中显示了如何获取页面访问令牌-https: //developers.facebook.com/docs/authentication/pages/

Summary: get manage_pages permission from the page admin and obtain the page access token from /USER_ID/accounts 摘要:从页面管理员获取manage_pages权限,并从/USER_ID/accounts获取页面访问令牌

Also, here: https://developers.facebook.com/docs/reference/api/page (see 'Mailbox' - shows how to read the mailbox in the Graph API - it should be applicable in FQL too) 另外,这里: https : //developers.facebook.com/docs/reference/api/page (请参阅“邮箱”-显示如何在Graph API中读取邮箱-它也应适用于FQL)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM