Solved

Add custom message to a conversation

  • 26 September 2023
  • 3 replies
  • 163 views

I am using the custom channels API to add receive custom messages

https://dev.frontapp.com/reference/post_channels-channel-id-incoming-messages

 

How do I add the new custom message to an existing conversation? The metadata.thread_ref seems to be independent from the conversation ids.

E.g. I added a custom message and pass

“metadata”: { “thread_ref”: “cnv_#####” }

doesn’t add the new message to that conversation and instead creates a new conversation. New messages using the same thread_ref goes under the new created conversation.

 

Thanks

icon

Best answer by jason 29 September 2023, 21:01

View original

3 replies

Userlevel 4
Badge +7

Hi @wesam , the thread_ref is a value that you designate; Front will not assign a thread_ref to conversations, and will instead thread by sender:recipent by default. 

If you want messages from the same sender to thread into the same conversation in Front, just omit the thread_ref, and Front will manage threading on your behalf. 

I need to be able to add the custom message to a specific conversation.

Receiving a custom message API doesn’t have a field to indicate if the message has multiple recipients. 
https://dev.frontapp.com/reference/post_channels-channel-id-incoming-messages

E.g. a message from Smith to John goes to conversation ABC

a message from Smith to John and Alex goes to conversation XYZ

If we thread the messages by sender, both of these messages will go under the same conversation (from Smith).

 

Userlevel 4
Badge +7

Hi Wesam,

Thanks for the context here. Threading into a specific conversation is supported via the Partner Channel API Message endpoints (https://dev.frontapp.com/reference/post_channels-channel-id-inbound-messages) provided you have set the external_conversation_id reference on the thread.

Alternatively, the import message endpoint allows you to set the conversation_id of the thread you need to put the message in when you’re using custom channels.

Reply