Skip to main content
rye_bread
Conversationalist
September 19, 2024
Solved

Twilio WhatsApp Messaging Templates

  • September 19, 2024
  • 14 replies
  • 641 views

Hello, 

I am assessing whether Front will work for my business use case. I need to use a number of Twilio WhatsApp channels for my clients all of which are Business accounts. Business accounts have some limitations around messaging and messaging windows and as a result need to use pre-cleared message templates when sending messages to users outside of a conversation window. Does Front support sending Twilio message templates via the Front API?

Additionally does Front support web hooks for listening to messages (both inbound and outbound messages to the channels?

Thanks!

Best answer by jason

Hi,

Yes - you can send templated messages using the API; the text of the sent message simply needs to (exactly) match the structure of your approved template. 

Yes - Front will subscribe to inbound messages received in Twilio and import them into Front immediately. 

For outbound messages sent outside of Front, Front will receive them eventually - check out this How to set up a Twilio WhatsApp inbox in Front guide for details. 

14 replies

Fronteer
September 27, 2024

We generally recommend listening for sending errors through webhook subscriptions in order to minimize the time between the error occurring and an API integration becoming aware of the error.  Polling won’t be able to account for the variance error timing, so we can’t advise on an effective polling period.  Webhooks will almost always be faster, and reduce your overall request quota consumption.

Front doesn’t explicitly differentiate between messages sent from app versus the API, but you can check the `author` property.  If you send from the API with no author, this field should be empty on message events.

Evan - Lead Technical Support Engineer
rye_bread
rye_breadAuthor
Conversationalist
September 27, 2024

@evano I am not seeing an author field in the payloads I am getting? I am specifically talking about monitoring web hooks and being able to determine from the message created webhook whether a message was created with the API or from Front

Front event payload: "authorization=FrontAuthorization(id='cmp_5t6zf') type='outbound_sent' payload=FrontPayload(conversation=FrontConversation(id='cnv_1d7ssuaj', subject='', status='assigned'), source=FrontSource(data=[FrontInbox(id='', name='', type=None, address=None, send_as=None, is_private=False, is_public=False, custom_fields={}), FrontInbox(id='inb_eoriz', name='Test', type='twilio_whatsapp', address='+', send_as='+', is_private=False, is_public=False, custom_fields={})]), target=FrontTarget(data=FrontMessage(id='msg_2is7ak0r', type='whatsapp', is_inbound=False, created_at=1727476343.584, blurb='xxx', body='xxx’, text='xxx', recipients=[FrontRecipient(name=None, handle='+', role='from'), FrontRecipient(name=None, handle='+', role='to')], attachments=[])))

rye_bread
rye_breadAuthor
Conversationalist
September 27, 2024

The only thing I can spot is subject having “re: “ vs being blank when sent via the API but that doesn’t seem robust?

Fronteer
September 30, 2024

Hi there!

That payload doesn’t have an author field as the message was sent through the API.  Please send a message from inside Front to see a webhook payload with an author object attached.

Evan - Lead Technical Support Engineer