Carousel
Last update: 6 hours ago by Irais Aguirre
Integration summary
- Endpoint:
POST https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging- Token: messaging token, in the
Authorization: Bearer {{wa-msg-api-token}}header (how to generate it)- Common fields:
from,to(phone number or BSUID) andtype(details)typevalues on this page:"template"- Response: the same for every message (see response)
Carousel templates with scrollable cards. All are sent with POST /v1/messaging; headers, common fields and the response are in HTTP connection. The general template structure (template and components objects) is in Template messages.
Carousel
A single text message accompanied by a set of up to 10 carousel cards in a horizontally scrollable view. It is sent as a carousel component with its cards in cards.
Body
Fields for Carousel:
| Name | Description | Type | Requirements |
|---|---|---|---|
| type | The value is "carousel". | String | Required |
| cards | A list of up to 10 card objects. Each card in the carousel must have:
| List of objects |
|
Card object
| Name | Description | Type | Requirements |
|---|---|---|---|
| card_index | Position of the card within the carousel, as a zero-based index: 0 is the first card, 1 the second, and so on. | Integer | Required |
| components | Array of components to add to the card. Components can be of type "header", "body", and "button". | List of objects | Required |
Example
Complete Carousel example (HTTP request and JSON body):
Carousel HTTP request
curl --location --request POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \-H 'Authorization: Bearer {{wa-msg-api-token}}' \-H 'Content-Type: application/json' \-d '{"from": "{{wa-phone-number}}","to": "{{recipient-wa-id}}","type": "template","template":{"language": "es_MX","name": "concepto_movil_carrusel_products","components":[{"type": "body","parameters":[{"type": "text","text": "25OFF"},{"type": "text","text": "25%"}]},{"type": "carousel","cards":[{"card_index": 0,"components":[{"type": "header","parameters":[{"type": "image","media_id": "966046148378667"}]}]},{"card_index": 1,"components":[{"type": "header","parameters":[{"type": "image","media_id": "448282164313965"}]}]},{"card_index": 2,"components":[{"type": "header","parameters":[{"type": "image","media_id": "1583971738812030"}]}]},{"card_index": 3,"components":[{"type": "header","parameters":[{"type": "image","media_id": "1104222870702261"}]}]}]}]}}'
Carousel body
{"from": "{{wa-phone-number}}","to": "{{recipient-wa-id}}","type": "template","template": {"language": "es_MX","name": "concepto_movil_carrusel_products","components": [{"type": "body","parameters": [{"type": "text","text": "25OFF"},{"type": "text","text": "25%"}]},{"type": "carousel","cards": [{"card_index": 0,"components": [{"type": "header","parameters": [{"type": "image","media_id": "966046148378667"}]}]},{"card_index": 1,"components": [{"type": "header","parameters": [{"type": "image","media_id": "448282164313965"}]}]},{"card_index": 2,"components": [{"type": "header","parameters": [{"type": "image","media_id": "1583971738812030"}]}]},{"card_index": 3,"components": [{"type": "header","parameters": [{"type": "image","media_id": "1104222870702261"}]}]}]}]}}
