Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook - Get conversation thread ID with message ID?

When I receive a "message received callback" event from the Facebook Realtime API (webhooks) I want to fetch previous messages in the conversation. To do that I need the ID of the conversation thread.

https://developers.facebook.com/docs/messenger-platform/webhook-reference/message?locale=en_US

The event does not contain any information about the ID of the conversation thread (t_id). It only contains the message ID (mid).

https://developers.facebook.com/docs/graph-api/reference/v2.8/conversation

Is there a way to get the conversation thread ID?

like image 740
John Avatar asked Mar 24 '17 09:03

John


People also ask

What is Facebook conversation API?

Retrieve conversations between your Instagram Professional account and your customers. Calls to the Conversation API will return: A list of conversations for your Instagram Professional account.

What is conversation API?

The Conversations API allows you to create conversational (back-and-forth) messaging across multiple channels: Chat, WhatsApp, and SMS.


1 Answers

I thing there is an easier way to do this. You can use the user_id filter on conversations:

https://graph.facebook.com/v3.0/--PAGE-ID--/conversations?fields=senders&user_id=

See the Parameters section from here: https://developers.facebook.com/docs/graph-api/reference/page/conversations/

like image 135
Mihai Avatar answered Oct 23 '22 21:10

Mihai