We want to use channels to support facilitating messaging in our app. At first, it looks like custom channels could work pretty well. The only issue is that when a message is first created by the “Receive custom messages” endpoint, we can’t immediately follow up with a query to get the message and conversation id because the message creation is apparently asynchronous. That would make our implementation more complex because we would have to retain the body of the message on our side in order to play back what was sent by the user while we wait for the message to completely flow through Front’s system. Would this be any different if we used application channels instead of custom channels- is the message creation also async when using the “Sync inbound message” API? Thanks!
Async message creation
Best answer by justin
Hi
Your analysis on the logic of how this works on the backend is correct.
With the receive custom messages endpoint, you will receive a response like the following:
{
"status": "accepted",
"message_uid": "1eab543f84a0785f7b6b8967cck18f4d"
}
Since the message creation process is happening asynchronously, you will not immediately see the Front conversation ID or message ID. However, you are provided the message UID in the response. With the UID, you can utilize resource aliases to identify the message data you are looking for within the API. See here: https://dev.frontapp.com/docs/resource-aliases-1#messages
This would enable you to fetch messages with the UID as follows:alt:uid:1eab543f84a0785f7b6b8967cck18f4d for the message with the uid 1eab543f84a0785f7b6b8967cck18f4d.
Let us know if you have any other questions!
Best,
Justin
Login to the community
No account yet? Create an account
Use your Front credentials
Log in with FrontEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
