Home How to query conversations by folder via Graph Api?
Reply: 1

How to query conversations by folder via Graph Api?

szedjani Published in 2017-12-07 01:07:54Z

My organisation recently started using folders on their Facebook page. The conversations then can be categorized as Inbox, Unread, Follow Up, Done and Spam.

I regularly download the messages via Graph API and everything worked fine when they kept all the conversations in the Inbox. However recently they categorized the conversations, so the inbox has only 7 elements at the moment, 0 elements in the Unread and Follow Up and countless elements in the Done and Spam folders.

I used the following query before:


Now it only returns the elements from the inbox.

The Graph API reference vaguely describes parameters like folder and tags. I tried to use the folder parameter like:


It all the time returned the same 7 elements from the inbox.

However, if I query me/conversations?folder=spam it returns 10 different elements, which does not overlap with the actual "Spam" folder and contains elements marked as "Done". (They are quite fishy conversations, so they might have been marked as spam and there might be two different definitions of being spam as marked as spam or being in the spam folder, I don't know.)

The API reference does not specify how to actually use the folder and the tags parameter and does not say anything how to query messages in the other folders.

Any idea how to access the conversations in the other folders? It's fine for me to query the folders one-by-one or to query from all folders as well.

andi79h Reply to 2017-12-15 12:23:49Z

After investigating this endpoint, I think ?folders is some ancient param before the rework of the messaging from messages in folders to conversations to pages. If I query my page for the spam folder, I never get messages listed, even though I flagged some with spam. And while they are flagged with spam, I do not get those on the conversations query (without folder=spam).

I believe, facebook changed the system into tags on conversations. You can get those like so: [page_id]/conversations?fields=participants,messages{tags,message}&folder=sent.

Note: The marked "no sent tag" is not related to the folder applied (as they dont work). Maybe the tagging on conversations is the reason you get the same result from querying threads at [page_id]?fields=threads{participants,messages{tags,message}}

So for now I think, one has to get over everthing there to read the inbox. Yet I am a bit sad about not getting flagged spam messages from the graph. I will investigate this a bit further later^^

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.359876 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO