Reply buttons
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:"interactive"- Response: the same for every message (see response)
Messages that include up to 3 options, each shown as a button. This message type gives users a faster way to pick from a menu when interacting with a business. They can also include up to 2 buttons that open a URL. They are sent with POST /v1/messaging; headers, common fields and the response are in HTTP connection.
Reply buttons
The type field must be "interactive" and the message content is sent in the replyButtons object. See the general structure of interactive messages.
Body
Fields for Reply buttons:
| Name | Description | Type | Requirements |
|---|---|---|---|
| replyButtons | Object with the reply buttons. Send only one: listMessages, replyButtons or flow (or another interactive message type). | Object | Conditional |
ReplyButtons object
| Name | Description | Type | Requirements |
|---|---|---|---|
| headerText | Header text (max 60 characters). | String | Optional. At most one header; priority: headerDocument > headerImage > headerVideo > headerText. |
| headerImage | Header image. | Object | Optional. At most one header. |
| headerVideo | Header video. | Object | Optional. At most one header. |
| headerDocument | Header document. | Object | Optional. At most one header. |
| body | The message text, which can include formatting and URLs (max 1024 characters). | String | Required |
| footer | The message footer (max 60 characters). Supports emojis and Markdown. | String | Optional |
| buttons | List of objects | List of objects | Required |
HeaderImage object
| Name | Description | Type | Requirements |
|---|---|---|---|
| link | File URL. | String | link, id or media_id required (one of them). |
| id | WhatsApp media resource ID. | String | link, id or media_id required (one of them). |
| media_id | WhatsApp media resource ID (alias for id). If both id and media_id are sent, media_id takes precedence. | String | link, id or media_id required (one of them). |
| providerName | Provider name. | String | Optional |
HeaderVideo object
| Name | Description | Type | Requirements |
|---|---|---|---|
| link | File URL. | String | link or id required (one of them). |
| id | WhatsApp media resource ID. | String | link or id required (one of them). |
| providerName | Provider name. | String | Optional |
HeaderDocument object
| Name | Description | Type | Requirements |
|---|---|---|---|
| link | File URL. | String | link or id required (one of them). |
| id | WhatsApp media resource ID. | String | link or id required (one of them). |
| fileName | File name. | String | Optional |
| providerName | Provider name. | String | Optional |
Buttons object
| Name | Description | Type | Requirements |
|---|---|---|---|
| id | Button ID. | String |
|
| title | Button text. | String |
|
- Up to 3 reply buttons per message.
- To send a message with a call-to-action URL button, use the dedicated CTA URL message type instead of adding
type/urlfields here.
Example
Complete Reply buttons example (HTTP request and JSON body):
Reply buttons with image
HTTP request with image
curl -X 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": "5215500000001","to": "5215500000002","type": "interactive","replyButtons":{"headerImage":{"link": "https://www.ejemplo.com/ejemplo_imagen.png"},"body": "Our soups are the best in town","footer": "Enjoy your meal","buttons":[{"id": "1","title": "Noodle soup"},{"id": "2","title": "Tortilla soup"},{"id": "3","title": "Pasta soup"}]}}'
Body with image
{"from": "5215500000001","to": "5215500000002","type": "interactive","replyButtons":{"headerImage":{"link": "https://www.ejemplo.com/ejemplo_imagen.png"},"body": "Our soups are the best in town","footer": "Enjoy your meal","buttons":[{"id": "1","title": "Noodle soup"},{"id": "2","title": "Tortilla soup"},{"id": "3","title": "Pasta soup"}]}}
Reply buttons with video
HTTP request with video
curl -X 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": "5215500000001","to": "5215500000002","type": "interactive","replyButtons":{"headerVideo":{"link": "https://www.ejemplo.com/ejemplo_video_3.7_MB.mp4"},"body": "Our soups are the best in town","footer": "Enjoy your meal","buttons":[{"id": "1","title": "Noodle soup"},{"id": "2","title": "Tortilla soup"},{"id": "3","title": "Pasta soup"}]}}'
Body with video
{"from": "5215500000001","to": "5215500000002","type": "interactive","replyButtons":{"headerVideo":{"link": "https://www.ejemplo.com/ejemplo_video_3.7_MB.mp4"},"body": "Our soups are the best in town","footer": "Enjoy your meal","buttons":[{"id": "1","title": "Noodle soup"},{"id": "2","title": "Tortilla soup"},{"id": "3","title": "Pasta soup"}]}}
Reply buttons with document
HTTP request with document
curl -X 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": "5215500000001","to": "5215500000002","type": "interactive","replyButtons":{"headerDocument":{"link": "https://www.ejemplo.com/ejemplo_documento.pdf","fileName": "my doc"},"body": "Our soups are the best in town","footer": "Enjoy your meal","buttons":[{"id": "1","title": "Noodle soup"},{"id": "2","title": "Tortilla soup"},{"id": "3","title": "Pasta soup"}]}}'
Body with document
{"from": "5215500000001","to": "5215500000002","type": "interactive","replyButtons":{"headerDocument":{"link": "https://www.ejemplo.com/ejemplo_documento.pdf","fileName": "my doc"},"body": "Our soups are the best in town","footer": "Enjoy your meal","buttons":[{"id": "1","title": "Noodle soup"},{"id": "2","title": "Tortilla soup"},{"id": "3","title": "Pasta soup"}]}}
Reply buttons with URL button
HTTP request with URL button
curl -X 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": "5215500000001","to": "5215500000002","type": "interactive","replyButtons":{"headerText": "Daily menu","body": "Our soups are the best in town","footer": "Enjoy your meal","buttons":[{"type": "cta_url","title": "See full menu","url": "https://www.ejemplo.com/menu"},{"id": "1","title": "Noodle soup"},{"id": "2","title": "Tortilla soup"}]}}'
Body with URL button
{"from": "5215500000001","to": "5215500000002","type": "interactive","replyButtons":{"headerText": "Daily menu","body": "Our soups are the best in town","footer": "Enjoy your meal","buttons":[{"type": "cta_url","title": "See full menu","url": "https://www.ejemplo.com/menu"},{"id": "1","title": "Noodle soup"},{"id": "2","title": "Tortilla soup"}]}}
