Messages
Endpoints for sending and managing messages
Send a message via the messaging API. Supports text, media, and template messages with automatic routing to marketing messages endpoint when applicable. Supports MM API fallback mechanism, more info: https://docs.360dialog.com/partner/messaging-and-calling/sending-marketing-messages/technical-details-for-mm-api.
API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.
Message Payload
Direct Send only. Category of the message to send as a template: utility or authentication (charged at the respective rates). Omitting it is equivalent to service: the regular service-message flow, where the message is dropped if the customer service window isn't open
utilityPossible values: whatsappBusiness-scoped user ID (BSUID) of the message recipient, in the form <ISO 3166-2 country code>.<up to 128 alphanumeric chars>. Alternative to 'to'; required if 'to' is omitted
US.13491208655302741918WhatsApp ID or phone number of the message recipient. Required unless recipient (BSUID) is provided
1234567890Direct Send only. Custom time-to-live of the message in seconds; requires category utility or authentication. Utility: 30-43200 (default 30 days). Authentication: 30-900 (default 600)
600Message sent successfully
Bad request
Unauthorized
Internal server error
POST /messages HTTP/1.1
Host: waba-v2.360dialog.io
D360-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1352
{
"audio": {
"id": "text",
"link": "text"
},
"category": "utility",
"context": {
"message_id": "text"
},
"direct_send_config": {
"template_name": "order_shipment_update"
},
"document": {
"id": "text",
"link": "text"
},
"image": {
"id": "text",
"link": "text"
},
"interactive": {
"action": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"body": {
"text": "text"
},
"footer": {
"text": "text"
},
"header": {
"document": {
"id": "text",
"link": "text"
},
"image": {
"id": "text",
"link": "text"
},
"text": "text",
"type": "text",
"video": {
"id": "text",
"link": "text"
}
},
"type": "button"
},
"location": {
"address": "text",
"latitude": 1,
"longitude": 1,
"name": "text"
},
"messaging_product": "whatsapp",
"reaction": {
"emoji": "text",
"message_id": "text"
},
"recipient": "US.13491208655302741918",
"recipient_type": "individual",
"sticker": {
"id": "text",
"link": "text"
},
"template": {
"components": [
{
"index": 1,
"parameters": [
{
"currency": {
"amount_1000": 1,
"code": "text",
"fallback_value": "text"
},
"date_time": {
"fallback_value": "text"
},
"document": {
"id": "text",
"link": "text"
},
"image": {
"id": "text",
"link": "text"
},
"location": {
"address": "text",
"latitude": 1,
"longitude": 1,
"name": "text"
},
"text": "text",
"type": "text",
"video": {
"id": "text",
"link": "text"
}
}
],
"sub_type": "quick_reply",
"type": "header"
}
],
"language": {
"code": "en_US"
},
"name": "hello_world"
},
"text": {
"body": "text",
"preview_url": true
},
"to": "1234567890",
"ttl_seconds": 600,
"type": "text",
"video": {
"id": "text",
"link": "text"
}
}{
"contacts": [
{
"input": "+1234567890",
"user_id": "US.13491208655302741918",
"wa_id": "1234567890"
}
],
"messages": [
{
"id": "text",
"message_status": "accepted"
}
],
"messaging_product": "text"
}Submit a sample of a message and use case you plan to send via Direct Send, so Meta can classify it and generate a matching template. Upload 3-4 samples covering the message types and use cases you intend to send.
API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.
Sample message payload
Required when submitting multiple button samples in a single request
Sample classified successfully
Bad request
Unauthorized
Internal server error
POST /messages/sample HTTP/1.1
Host: waba-v2.360dialog.io
D360-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 356
{
"category": "utility",
"interactive": {
"action": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"body": {
"text": "text"
},
"footer": {
"text": "text"
},
"header": {
"document": {
"id": "text",
"link": "text"
},
"image": {
"id": "text",
"link": "text"
},
"text": "text",
"type": "text",
"video": {
"id": "text",
"link": "text"
}
},
"type": "button"
},
"text": {
"body": "text",
"preview_url": true
},
"type": "text"
}{
"category": "UTILITY",
"success": true
}Last updated
Was this helpful?