是否可以从特定用户那里获取消息?
如果我想收到收件人是我自己和 x 的所有邮件
我没有找到创建这种查询的方法,有可能吗?
var fbid = your_fbuid_here;
FB.api({
method: 'fql.query',
query: 'SELECT thread_id, author_id, created_time FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0) AND author_id = ' + fbid + ' ORDER BY created_time ASC LIMIT 1'
}, function ( threadresponse ) {
FB.api({
method: 'fql.query',
query: 'SELECT thread_id, body, author_id, created_time FROM message WHERE thread_id = ' + threadresponse[0].thread_id + ' ORDER BY created_time ASC'
}, function ( inboxresponse ) {
//do stuff here with results
});
});
或者你可以这样做
var fbid =the _freind_fb_uid_here;
FB.api({
method: 'fql.query',
query: 'SELECT thread_id, body, author_id, created_time FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0) AND author_id = ' + fbid + ' ORDER BY created_time DESC'
}, function ( threadresponse ) {
//do stuff here with results
});
facebook facebook-fql facebook-api facebook-graph-api facebook-fql-query
现在 FQL 没有 field author_id
,只有originator
and snippet_author
。但是这个字段包含错误的数据。例如,userA 向我发送 (userB) 消息:userA 创建线程。无论如何,我看到了,那个发起者有我(userB)。
最佳使用方式recipients
:
SELECT recipients,snippet,object_id,updated_time,unread,unseen,thread_id FROM thread WHERE folder_id=0 AND recipients IN (userA_fid, userB_fid)
但它也不起作用并返回空数据......