Skip to main content

Send Buttons with Video

Method#

/send-button-list#

POST https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/send-button-list

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Warning

Button sending is currently available, but there are some decisive factors for operation. For more details visit the Button Status topic.

Concept#

This method allows you to send videos with action buttons. The button content, e.g., YES/NO, can be chosen by the user and will be used as a response to the message sent along with the buttons.

image


Attributes#

Required#

AttributesTypeDescription
phonestringPhone number (or group ID in the case of group sending) of the recipient in the format DDI DDD NUMBER e.g., 551199999999. IMPORTANT Send only numbers, without formatting or masking
messagestringText to be sent
buttonListbuttonListButton object
important

The "message" attribute cannot be empty!

Optional#

AttributesTypeDescription
delayMessagenumberThis attribute adds a delay to the message. You can choose a range of 1~15 seconds, meaning how many seconds it will wait to send the next message (e.g., "delayMessage": 5). The default delay, if not specified, is 1~3 seconds.

Button List#

AttributesTypeDescription
videostringURL or Base64 of the video to be sent
buttonsbuttonList of buttons to be sent

Button#

AttributesTypeDescription
labelstringText for the button

Optional Button#

AttributesTypeDescription
idstringButton identifier

Request Body#

{
"phone": "5511999999999",
"message": "Is Z-API Good?",
"buttonList": {
"video": "video URL",
"buttons": [
{
"id": "1",
"label": "Great"
},
{
"id": "2",
"label": "Excellent"
}
]
}
}

Response#

200#

AttributesTypeDescription
zaapIdstringID on Z-API
messageIdstringID on WhatsApp
idstringAdded for compatibility with Zapier, it has the same value as messageId

Example

{
"zaapId": "3999984263738042930CD6ECDE9VDWSA",
"messageId": "D241XXXX732339502B68",
"id": "D241XXXX732339502B68"
}

405#

In this case, ensure that you are correctly sending the method specification, i.e., verify if you sent POST or GET as specified at the beginning of this topic.

415#

If you receive a 415 error, ensure to add the "Content-Type" header to the request object you are sending, which in most cases is "application/json".


Webhook Response#

Link to the webhook response (upon receiving)

Webhook


Code#