POST /templates/send.status: sent. Check delivery later with GET /messages/{message_id}.media_type | What to send |
|---|---|
text | message |
image, video, document | file_url (the type is also detected from the file extension), with message as the caption |
location | location with latitude and longitude, plus optional name and address |
button | message and action.buttons: 1 to 3 buttons, each {"type": "reply", "reply": {"id", "title"}}; titles up to 20 characters |
list | message and action with button (up to 20 characters) and sections: up to 10 sections, each with a title (up to 24 characters) and up to 10 rows of {"id", "title", "description"} |
cta_url | message and action {"name": "cta_url", "parameters": {"display_text", "url"}}; display_text up to 20 characters |
header ({"text"} or {"file_url"}) and footer (text) are optional for button, list and cta_url messages.{
"conversation_id": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",
"media_type": "button",
"message": "Apakah pesanan sudah diterima?",
"action": {
"buttons": [
{
"type": "reply",
"reply": {
"id": "received_yes",
"title": "Sudah"
}
},
{
"type": "reply",
"reply": {
"id": "received_no",
"title": "Belum"
}
}
]
}
}{
"conversation_id": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",
"media_type": "cta_url",
"message": "Lacak pesanan Anda di sini.",
"action": {
"name": "cta_url",
"parameters": {
"display_text": "Lacak pesanan",
"url": "https://example.com/track/12345"
}
}
}curl --location '/messages/whatsapp' \
--header 'api_key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"conversation_id": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",
"message": "Pesanan Anda sudah dikirim hari ini."
}'{
"success": true,
"status_code": 201,
"data": {
"id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
"message": "Pesanan Anda sudah dikirim hari ini.",
"sent_by": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"sent_by_name": "Admin Toko",
"sent_by_type": "api",
"conversation_id": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",
"business_id": "2f7431e4-cd89-4daf-a40d-a5d779b3dd1e",
"media_url": null,
"media_type": "text",
"status": "sent",
"error": null,
"is_deleted": false,
"additional_data": {
"billing_mode": "credit_card",
"is_balance_locked": false
},
"action": null,
"header": null,
"footer": {
"text": null
},
"location": null
}
}