message object:
type is one of text, template, interactive, media, location or contact; content depends on it.
Each endpoint accepts the types that make sense for it: for example a Shortext inbound message is
text only.
Text
The text, up to 4,096 characters. On WhatsApp, a URL in the text is rendered as a link.
On WhatsApp, show a preview of the first link of the text.
false sends the link without its preview.Template
The template language, for example
fr or en_US. The template must be approved in this language.The body variables, by name:
{ "name": "Brice", "order": "A-1042" }. For templates with numbered variables ({{1}}, {{2}}), give a list of WhatsApp parameters in order.For a text header with variables:
{ "name": "value" }. For a media header: { "url": "https://..." } (and filename for a document). Without url, the media stored with the template is sent.The value of each button that needs one, by its index (from 0, as listed by
GET /templates): { "0": "A-1042", "1": "SAVE20" }. The end of a dynamic link, the coupon of a copy-code button, or the payload of a quick reply.For an authentication template only: the one-time code (up to 15 characters). Shortext puts it in the body and in the code button.
1002 with an explicit message when the template does not exist on the number, is not approved in that language, or misses a variable (body.missing lists them). See Send a template.
Interactive
button (reply buttons), quick_reply (an alias of button), list (a menu of options in sections), cta_url (a button that opens a link), flow, payment or carousel. Their action is described in WhatsApp message types.For
button and quick_reply: a list of 1 to 3 buttons { "id", "title" } (title up to 20 characters). For list: { "button", "sections": [ { "title", "rows": [ { "id", "title", "description" } ] } ] }. For cta_url: { "parameters": { "display_text", "url" } }. For the other types, see WhatsApp message types.{ "type": "text" | "image" | "video" | "document", "value": "text or URL", "filename": "for documents" }. A text header is limited to 60 characters; cta_url accepts a text or an image header.Up to 60 characters.
Media
Sticker
A sticker is amedia message with media_type sticker: a WebP image of 512 x 512 pixels, 100 KB at most (500 KB if animated), without caption.
Location
name and an address, the place shows as a place card; otherwise as a position on a map.
Contact
1 to 5 numbers
{ "number", "type" }. type is cell (default), main, iphone, home or work.Rendering by channel
Messages in responses and webhooks
Messages returned by the API and sent inmessage.* webhooks wrap the same object:
directionisinbound(from the contact) oroutbound(from the AI agent, a member of your team or the API).message.idis the id on the channel (WhatsApp message id; on a Shortext endpoint, your own message id).- A position shared by a contact (WhatsApp or Telegram) arrives with
message.typelocationand itscontent(latitude,longitude,name,address); its readable text is “name, address, map link”. On Telegram, a phone number shared by a contact arrives with the typecontacts. The AI agent reads these messages and answers them. statusisreceivedfor inbound messages, thensent,delivered,readorfailedfor outbound ones; changes are pushed by themessage.statuswebhook.