logo
enes

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) and type (details)
  • type values 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:

NameDescriptionTypeRequirements
replyButtonsObject with the reply buttons. Send only one: listMessages, replyButtons or flow (or another interactive message type).ObjectConditional

ReplyButtons object

NameDescriptionTypeRequirements
headerTextHeader text (max 60 characters).StringOptional. At most one header; priority: headerDocument > headerImage > headerVideo > headerText.
headerImageHeader image.ObjectOptional. At most one header.
headerVideoHeader video.ObjectOptional. At most one header.
headerDocumentHeader document.ObjectOptional. At most one header.
bodyThe message text, which can include formatting and URLs (max 1024 characters).StringRequired
footerThe message footer (max 60 characters). Supports emojis and Markdown.StringOptional
buttonsList of objectsList of objectsRequired

HeaderImage object

NameDescriptionTypeRequirements
linkFile URL.Stringlink, id or media_id required (one of them).
idWhatsApp media resource ID.Stringlink, id or media_id required (one of them).
media_idWhatsApp media resource ID (alias for id). If both id and media_id are sent, media_id takes precedence.Stringlink, id or media_id required (one of them).
providerNameProvider name.StringOptional

HeaderVideo object

NameDescriptionTypeRequirements
linkFile URL.Stringlink or id required (one of them).
idWhatsApp media resource ID.Stringlink or id required (one of them).
providerNameProvider name.StringOptional

HeaderDocument object

NameDescriptionTypeRequirements
linkFile URL.Stringlink or id required (one of them).
idWhatsApp media resource ID.Stringlink or id required (one of them).
fileNameFile name.StringOptional
providerNameProvider name.StringOptional

Buttons object

NameDescriptionTypeRequirements
idButton ID.String
  • Required.
  • Maximum 256 characters.
titleButton text.String
  • Required.
  • Maximum 20 characters.
Button limits:
  • 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/url fields 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"
}
]
}
}


Previous
List messages
Next
Call to action (URL)