Send a Whatsapp message
Sends a WhatsApp message using a Telnyx WhatsApp-enabled number. The message body, interactive elements, media, location, and reaction content are specified in the whatsapp_message field. Delivery progress and final disposition are reported asynchronously through messaging webhooks.
Request body
Example request
{
"from": "+13125551234",
"to": "+13125551234",
"type": "WHATSAPP",
"whatsapp_message": {
"audio": {
"link": "http://example.com/media.jpg"
},
"document": {
"link": "http://example.com/media.jpg"
},
"image": {
"link": "http://example.com/media.jpg"
},
"interactive": {
"action": {
"cards": [
{
"header": {
"image": {
"link": "http://example.com/media.jpg"
},
"video": {
"link": "http://example.com/media.jpg"
}
}
}
]
},
"header": {
"document": {
"link": "http://example.com/media.jpg"
},
"image": {
"link": "http://example.com/media.jpg"
},
"video": {
"link": "http://example.com/media.jpg"
}
}
},
"sticker": {
"link": "http://example.com/media.jpg"
},
"template": {
"language": {
"code": "en_US",
"policy": "deterministic"
},
"name": "order_confirmation",
"template_id": "019cd44b-3a1c-781b-956e-bd33e9fd2ac6"
},
"text": {
"body": "Hello from Telnyx!"
},
"video": {
"link": "http://example.com/media.jpg"
}
}
}Response
Successful operation
Example response
{
"data": {
"body": {
"audio": {
"link": "http://example.com/media.jpg"
},
"document": {
"link": "http://example.com/media.jpg"
},
"image": {
"link": "http://example.com/media.jpg"
},
"interactive": {
"action": {
"cards": [
{
"header": {
"image": {
"link": "http://example.com/media.jpg"
},
"video": {
"link": "http://example.com/media.jpg"
}
}
}
]
},
"header": {
"document": {
"link": "http://example.com/media.jpg"
},
"image": {
"link": "http://example.com/media.jpg"
},
"video": {
"link": "http://example.com/media.jpg"
}
}
},
"sticker": {
"link": "http://example.com/media.jpg"
},
"template": {
"language": {
"code": "en_US",
"policy": "deterministic"
},
"name": "order_confirmation",
"template_id": "019cd44b-3a1c-781b-956e-bd33e9fd2ac6"
},
"text": {
"body": "Hello from Telnyx!"
},
"video": {
"link": "http://example.com/media.jpg"
}
},
"direction": "outbound",
"encoding": "utf-8",
"id": "4031938e-60e4-4235-a8dd-0b1c55a23e7a",
"messaging_profile_id": "4001781e-626f-4a41-a914-b1b682150f94",
"organization_id": "9f61d8e1-7687-4d6d-9cae-9ff682985983",
"record_type": "message",
"to": [
{
"carrier": "Verizon Wireless",
"line_type": "Wireless",
"phone_number": "+13125551234",
"status": "queued"
}
],
"type": "WHATSAPP",
"wait_seconds": 0.5
}
}Changes
Changed in 2 of the 61 revisions of this API.7
- ▲
the response's body type changed from
objectto no type for statusresponse-body-type-changed
- ▲
the
/response's property type changed fromobjectto no type for statusresponse-property-type-changed
- ▲
the
//response's property type changed fromintegertostring, and format fromint32to no format for statusresponse-property-type-changed
This revision also has 64 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ▲
the response's body type changed from no type to
objectfor statusresponse-body-type-changed
- ▲
the
/response's property type changed from no type toobjectfor statusresponse-property-type-changed
- ▲
the
//response's property type changed fromstringtointeger, and format from no format toint32for statusresponse-property-type-changed
- ▲
the
///response's property format changed fromjson-pointerto no format for statusresponse-property-type-changed
This revision also has 41 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲