如何通过FQL或GRAPH API为特定用户获取消息?

时间:2012-02-07 23:59:05

标签: facebook-graph-api facebook-fql fql.multiquery

我想从https://graph.facebook.com/me/inbox或通过FQL检索特定用户的所有邮件,例如:“所有来自和来自ID的用户的邮件:123456789”

我可以使用FQL多查询吗?

2 个答案:

答案 0 :(得分:3)

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
                });
            });

答案 1 :(得分:1)

  

我可以使用FQL多查询吗?

当收件箱属于经过身份验证的应用用户并且已授予相应权限时,

可能