Messaging windows & WhatsApp templates
Some channels (for example WhatsApp) enforce time-limited messaging windows: you may only send free-form text for a period after the customer’s last message. Outside that window you typically must use pre-approved templates.
Instaply provides endpoints to:
- Inspect the thread’s channel and whether the messaging window is open.
- List available WhatsApp templates for the thread.
- Send a template using
contentSidvia Send message.
Get customer thread details
Section titled “Get customer thread details”Use this to see which channel the thread uses and whether free-form messages are allowed.
Endpoint: GET https://me.instaply.com/api/get-customer-thread-details?customerThreadId=<id>
Example response:
{ "customerChannel": "WHATSAPP", "status": "replied", "isMessagingWindowOpen": false}Fields
Section titled “Fields”customerChannel— Channel type (for exampleWHATSAPP).status— Thread status:waiting,replied, orresolved.isMessagingWindowOpen(boolean) —true: free-form messages allowed.false: use templates (contentSid).
Get WhatsApp templates
Section titled “Get WhatsApp templates”When the messaging window is closed, send an approved template. List templates for the thread:
Endpoint: GET https://me.instaply.com/api/get-whatsapp-templates?customerThreadId=<id>
Example response:
{ "templates": [ { "title": "issue_back", "text": "Bonjour, nous sommes désolés de ne pas avoir pu vous répondre plus tôt. Si vous êtes toujours en attente d’une réponse, veuillez répondre OUI.", "contentSid": "HXdf71e8696fbd234e0115c69a542cb1" } ]}Template object fields
Section titled “Template object fields”| Field | Description |
|---|---|
title | Template name |
text | Template body text |
contentSid | Identifier to pass as contentSid in Send message |