curl --request POST \
--url https://api.messaging.phonovation.com/whatsapp/1/message/audio \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "353861234583",
"to": "353861234584",
"messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
"content": {
"mediaUrl": "http://example.com/audio"
},
"callbackData": "Callback data",
"notifyUrl": "https://www.example.com/whatsapp"
}
'{
"to": "353861234584",
"messageCount": 1,
"messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
}
}Send WhatsApp audio message
Send an audio to a single recipient. Audio messages can only be successfully delivered if the recipient has contacted the business within the last 24 hours, otherwise template message should be used.
The API response will not contain the final delivery status, use Delivery Reports instead.
Required scope: Enable one of: message:send, whatsapp:message:send, whatsapp:manage.
curl --request POST \
--url https://api.messaging.phonovation.com/whatsapp/1/message/audio \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "353861234583",
"to": "353861234584",
"messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
"content": {
"mediaUrl": "http://example.com/audio"
},
"callbackData": "Callback data",
"notifyUrl": "https://www.example.com/whatsapp"
}
'{
"to": "353861234584",
"messageCount": 1,
"messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
}
}Authorizations
This is the most secure authorization type and the one with the most flexibility.
API keys can be generated by calling the dedicated API method. Furthermore, API keys can have a limited scope and cover only some API methods. Lastly, they can be revoked at any time. This range of possibilities makes API keys well suited for separating the API access rights across multiple applications or use cases. Finally, the loss of an API key is easily manageable.
You can manage your API keys from GUI, or programmatically with dedicated API.
API key Authorization header example:
Authorization: App 003026bbc133714df1834b8638bb496e-8f4b3d9a-e931-478d-a994-28a725159ab9
Body
Registered WhatsApp sender number. Must be in international format and comply with WhatsApp's requirements.
1 - 24Message recipient number in international format or WhatsApp business-scoped user ID.
1 - 150The content object to build a message that will be sent.
Show child attributes
Show child attributes
The ID that uniquely identifies the message sent.
200Custom client data that will be included in a Delivery Report.
4000The URL on your callback server to which delivery and seen reports will be sent. Delivery report format, Seen report format.
2048Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our documentation.
255Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our documentation.
255Context object to define WhatsApp-specific metadata about a message.
Show child attributes
Show child attributes
Response
Message accepted for delivery
The destination address of the message.
"353861234572"
Number of messages required to deliver.
1
The ID that uniquely identifies the message sent. If not passed, it will be automatically generated and returned in a response.
"06df139a-7eb5-4a6e-902e-40e892210455"