Skip to main content

Send Carousel

Method#

/send-carousel#

POST https://api.z-api.io/instances/SUA_INSTANCIA/token/SEU_TOKEN/send-carousel

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Attention

Sending buttons accompanying the carousel is currently available, but there are some decisive factors for functionality. For more details, access the topic Button Functionality

Concept#

With this method, you can send carousel messages with images, text, and action buttons. Using action buttons, you can redirect to links, make calls, and also provide standard responses.

image


Attributes#

Required#

AttributesTypeDescription
phonestringPhone number (or group ID in cases of sending to groups) of the recipient in the format DDI DDD NUMBER e.g., 551199999999. IMPORTANT Send only numbers, without formatting or mask
messagestringText to be sent
carouselcarouselCard[]Array of objects with carousel cards

carouselCard#

AttributesTypeDescription
textstringCard text
imagestringCard image

Optional carouselCard#

AttributesTypeDescription
buttonsbuttonActions[]Array of objects of type buttonActions

buttonActions#

AttributesTypeDescription
typestringButton types to be sent (CALL, URL, REPLY)
phonestringNumber assigned to the button if it is of type CALL
urlstringLink assigned to the button if it is of type URL.
labelstringButton text

Optional buttonActions#

AttributesTypeDescription
idstringButton identifier

Optional#

AttributesTypeDescription
delayMessagenumberIn this attribute, a delay is added to the message. You can choose a range from 1~15 sec, 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 sec

Request Body#

{
"phone": "551199999999",
"message": "Message text",
"carousel": [
{
"text": "Card text",
"image": "https://firebasestorage.googleapis.com/v0/b/zaap-messenger-web.appspot.com/o/logo.png?alt=media",
"buttons": [
{
"id": "1",
"label": "Button name",
"url": "https://z-api.io",
"type": "URL"
},
{
"id": "2",
"label": "Button name",
"type": "REPLY"
}
]
},
{
"text": "Card text",
"image": "https://firebasestorage.googleapis.com/v0/b/zaap-messenger-web.appspot.com/o/logo.png?alt=media",
"buttons": [
{
"id": "1",
"label": "Button name",
"url": "https://z-api.io",
"type": "URL"
},
{
"id": "2",
"label": "Button name",
"type": "REPLY"
}
]
}
]
}
{
"phone": "551199999999",
"message": "Message text",
"carousel": [
{
"text": "Card text",
"image": "https://firebasestorage.googleapis.com/v0/b/zaap-messenger-web.appspot.com/o/logo.png?alt=media"
},
{
"text": "Card text",
"image": "https://firebasestorage.googleapis.com/v0/b/zaap-messenger-web.appspot.com/o/logo.png?alt=media"
}
]
}

Response#

200#

AttributesTypeDescription
zaapIdstringid in z-api
messageIdstringid in 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., check if you sent POST or GET as specified at the beginning of this topic.

415#

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


Webhook Response#

Link to the webhook response (upon receipt)

Webhook


Code#