Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
737 views
in Technique[技术] by (71.8m points)

facebook - How to query conversations by folder via Graph Api?

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:

me/conversations?fields=updated_time,messages.limit(100){message,from,created_time}&limit=100

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:

me/conversations?folder=done
me/conversations?folder=unread
me/conversations?folder=randomstring

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The documentation might need some updating. But for now, I can query messages in "DONE" via:

/{page-id}/conversations?tags=action:archived

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...