Skip to main content
Solved

Adding a tag to a custom message using the API (+ resource aliases)

  • December 7, 2022
  • 2 replies
  • 169 views

Front Developer
Forum|alt.badge.img+2

How can I add a tag to a message that was created via the Receive custom messages endpoint?

 

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

 

There's documentation for how to attach a tag to a Conversation but my understanding is that these two are different primitives. See here:

https://dev.frontapp.com/reference/post_conversations-conversation-id-tags

Best answer by Javier - Developer Relations

Maybe this documentation page will help clear things up a little. 

 

Once the incoming message has been created at POST

https://api2.frontapp.com/channels/{channel_id}/incoming_messages, you will then need to query the "Get Message" endpoint by using the message_uid as a resource alias.

 

An example request might look like this: 
https://api2.frontapp.com/messages/alt:uid:abcd1234

Then once you have retrieved the message, you can use the conversation ID from that to then add the tag. 

 

🏷️ Tags can only be added at the conversation level, rather than the message level. 

 

--Molly

2 replies

Javier - Developer Relations
Forum|alt.badge.img+9

Maybe this documentation page will help clear things up a little. 

 

Once the incoming message has been created at POST

https://api2.frontapp.com/channels/{channel_id}/incoming_messages, you will then need to query the "Get Message" endpoint by using the message_uid as a resource alias.

 

An example request might look like this: 
https://api2.frontapp.com/messages/alt:uid:abcd1234

Then once you have retrieved the message, you can use the conversation ID from that to then add the tag. 

 

🏷️ Tags can only be added at the conversation level, rather than the message level. 

 

--Molly


Front Developer
Forum|alt.badge.img+2

Thanks for the help.

 

My query kept failing because I was doing messages/message_id

I didn't know about the alt:uid: prefix.