Solved

How to sync tags to messages (integration)?

  • 17 July 2023
  • 1 reply
  • 233 views

Badge

Hi! 

We are in the process of enhancing our integration (telephony) with Front by adding tag synchronisation. I have some questions around this I was hoping someone could help clarify.

 

Currently, we push messages into Front each time a call is made in Cordless (our platform). We want to extend this by also pushing tags, which our users assign to these calls within Cordless, into Front.

At the moment we’re using custom channels and custom messages https://dev.frontapp.com/reference/post_channels-channel-id-incoming-messages.
 

The question is: Is it possible to add tags to these custom messages (it is not clear from the documentation)? If so, how can we go about it? Specifically, we anticipate needing to update messages after they've been created in Front to attach these tags, as users might not assign tags instantly.

 

If we can’t update messages - I suppose, we can update a message’s conversation, but how do we find a conversation if we only know message_uid?
 

Thanks in advance for your help!

icon

Best answer by jason 18 July 2023, 18:18

View original

1 reply

Userlevel 4
Badge +7

Hi Vlad,

First off, it’s important to understand that messages are immutable, so can not be modified after being created, and Tags are applied to the Conversation object, rather than to Messages. 

Right now it’s not possible to apply tags to conversations via the Receive custom messages endpoint you mentioned, but you can easily use the add conversation tag endpoint to apply tags. 

As you called out, when you receive messages via the Receive custom messages endpoint, you receive only a message_uid field in response (no conversation ID). To fetch the conversation ID associated with this message, we typically recommend first fetching the Message by UID using Resource Aliases

So as an example; we receive a new message, and receive a response with a message UID;

{“message_uid”: “abcdef1234567890”}

We can then use this message_uid as the resource alias to fetch the conversation:
GET /messages/alt:uid:abcdef1234567890

The API response will give us the message information including the conversation ID, which we can then send along to the Add conversation tag endpoint to apply a new tag.

I hope this helps!

Reply