Solved

Set conversation custom field when importing message

  • 6 April 2023
  • 2 replies
  • 163 views

Badge

Hi there,

I’m using the import message API (https://dev.frontapp.com/reference/import-inbox-message) to create a conversation in front when a user takes an action on our website. I’ve done that so the message is from the user / a contact, and that the messages can be replied to by our team.

When importing the message, is it possible to set a value for a custom field on the conversation that is created? Or will I need to change my workflow to create a conversation first, then import the message to that conversation? The use case wanting to assign the order ID the conversation relates to, to make it easier to find again via the API.

Thanks!

icon

Best answer by evano 7 April 2023, 01:52

View original

2 replies

Userlevel 2
Badge +5

Hi!

Conversation custom fields can only be updated after the conversation is created:

https://dev.frontapp.com/reference/patch_conversations-conversation-id

With the only exception being discussions:

https://dev.frontapp.com/reference/create-conversation

 

However, I understand wanting to minimize additional requests.  As an alternative solution, on the import message endpoint, you may want to consider tagging with the order ID on your first request.  That endpoint takes tag names and will create new tags if the name doesn’t match an existing tag.  So long as your order IDs are unique and shorter than 64 characters, this approach should work for you.

Badge

Thanks for the reply. I was looking to avoid tags as there’s likely to be several hundred of these over a few months & I don’t want the tags list/interface to become a mess for end users. I’ll look at switching to creating & updating a conversation before sending the message.

Reply