0

How can I fetch page conversations with unread messages only using either Graph API or FQL ?

I did not found any table reference for that in FQL and in Graph API I can't figure out if I can filter unread messages only

Aviram Segal
  • 10,962
  • 3
  • 39
  • 52

3 Answers3

2

I did it this way.

SELECT sender, body FROM unified_message 
WHERE thread_id IN 
     (SELECT thread_id FROM unified_thread WHERE folder = 'inbox' AND unread=1) 
 AND unread=1 
ORDER BY timestamp DESC

for more information: How to get unread messages using FQL?

Community
  • 1
  • 1
Dany19
  • 551
  • 9
  • 26
0

From the documentation:

The unread parameter is not indexed, and thus cannot be searched. You'll havta get all the messages, and filter them yourself.

Tommy Crush
  • 2,790
  • 1
  • 15
  • 18
0

this is the fql for view unread conversation:

SELECT message_id, author_id, body, created_time, viewer_id, thread_id FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0 and unread != 0)
Ifwat Ibrahim
  • 1,523
  • 4
  • 16
  • 28