05-16-2024 02:07 AM
Hello,
I'm building an integration using Conversation API specific for WHATSAPP channel.
We send both templated and non templated messages using endpoint
/messages:send
I read both sinch and meta documentation about when a new conversation is open, depending on the message category and time frame (24h). I'm wondering if there is a way using api, to understand if the whatsapp conversation is still open for a certain category, to let the users know if they're in the time frame to contact their customers.
I see the endpoint:
/conversations/{conversation_id}
having a field active in the response, but I think this is not referring to the meta conversation, but is referring to the sinch conversation.
Any suggestion on how to retrieve (or calculate) this data in a easy way (maybe there is somewhere the timestamp of when the meta conversation start?)
Solved! Go to Solution.
05-16-2024 11:16 AM - edited 05-17-2024 08:03 AM
Hello, thank you for reaching out!
I believe your understanding regarding our conversations
endpoint is correct: the information returned from API calls made to this endpoint is specific to Sinch, and may not align with the corresponding WhatsApp conversation. I will confirm this with the product team.
That being said, you can determine when a WhatsApp conversation begins, the WhatsApp conversation to which a particular message belongs, and the pricing category of your WhatsApp conversations through delivery receipts. Specifically, this information is included in delivery receipts for messages sent on the WhatsApp channel that reach a DELIVERED
status. I have summarized the relevant information below, but we encourage you to fully review the linked section above in order to determine what information is required to meet your needs.
Note: In order to receive delivery receipts, you must have at least one webhook that is subscribed to the MESSAGE_DELIVERY
trigger. You can create up to 5 webhooks per Conversation API app.
To inform the Conversation API user about the pricing of their WhatsApp conversation, delivery receipt callbacks with the DELIVERED
status will populate the message_metadata
field with information about:
pricing_category
, which is the pricing category for the conversation.whatsapp_conversation_id
, which is the WhatsApp conversation id (messages with the same id belong to the same conversation).When the first delivery receipt with a DELIVERED
status and a new whatsapp_conversation_id
is received, the customer is charged for a new conversation in the conversation category. All messages sent to the recipient that are part of the same conversation within a 24-hour window don't incur additional charges. This information can be used to note when new WhatsApp conversations begin, and can be tracked in order to calculate how much time is left in a particular WhatsApp conversation.
As I said, I'll reach out to the product team to see if there is any other relevant information I can share with you. I'll either update this post or message you directly with my findings. In the meantime, please feel free to add replies to this post if you have any other questions regarding this topic.
Thank you again!
05-16-2024 11:16 AM - edited 05-17-2024 08:03 AM
Hello, thank you for reaching out!
I believe your understanding regarding our conversations
endpoint is correct: the information returned from API calls made to this endpoint is specific to Sinch, and may not align with the corresponding WhatsApp conversation. I will confirm this with the product team.
That being said, you can determine when a WhatsApp conversation begins, the WhatsApp conversation to which a particular message belongs, and the pricing category of your WhatsApp conversations through delivery receipts. Specifically, this information is included in delivery receipts for messages sent on the WhatsApp channel that reach a DELIVERED
status. I have summarized the relevant information below, but we encourage you to fully review the linked section above in order to determine what information is required to meet your needs.
Note: In order to receive delivery receipts, you must have at least one webhook that is subscribed to the MESSAGE_DELIVERY
trigger. You can create up to 5 webhooks per Conversation API app.
To inform the Conversation API user about the pricing of their WhatsApp conversation, delivery receipt callbacks with the DELIVERED
status will populate the message_metadata
field with information about:
pricing_category
, which is the pricing category for the conversation.whatsapp_conversation_id
, which is the WhatsApp conversation id (messages with the same id belong to the same conversation).When the first delivery receipt with a DELIVERED
status and a new whatsapp_conversation_id
is received, the customer is charged for a new conversation in the conversation category. All messages sent to the recipient that are part of the same conversation within a 24-hour window don't incur additional charges. This information can be used to note when new WhatsApp conversations begin, and can be tracked in order to calculate how much time is left in a particular WhatsApp conversation.
As I said, I'll reach out to the product team to see if there is any other relevant information I can share with you. I'll either update this post or message you directly with my findings. In the meantime, please feel free to add replies to this post if you have any other questions regarding this topic.
Thank you again!
05-17-2024 12:20 AM
Thank you Sam!!
Your answer is very useful to me.
Can I add some other question regarding this topic?
Does the MESSAGE_DELIVERY trigger notifies also the opening of service and free entry point conversations?
05-17-2024 08:00 AM - edited 05-17-2024 08:02 AM
No problem, happy to help!
Regarding your follow-up question: the MESSAGE_DELIVERY
trigger delivers receipts for most messages sent using the Conversation API. This includes messages that belong to paid WhatsApp conversation types, messages that belong to service or free entry point WhatsApp conversation types, and other messages that are sent on any of the supported Conversation API channels.
Additionally, the message_metadata
field will indicate when a message belongs to a service or free entry point conversation. An example of a receipt that corresponds to a message sent during a service conversation can be seen in our documentation on receiving WhatsApp pricing information in delivery receipts.
You may also want to review Meta's rules regarding free entry point conversations, as some of the corresponding time limits appear to be different than other conversation types. Specifically, it looks like free entry point conversations last 72 hours, rather than 24 hours.
Please let me know if you have any other questions. Thank you!