Interactive list messages allow you to present users with a list of options to choose from.
Arguments
Explanation
type
The type of the message
e.g 'text' | 'interactive' | 'file' | 'video' | 'image'
interactive
Construct a request & the expected response using the specified API endpoint
We partially support interactive messages. These messages will appear in the conversation history as encoded JSON within a text-type message, preserving their original structure and content.
{
"type": "interactive",
"interactive": {
"type": "list",
"header": {
"type": "text",
"text": "Survey"
},
"body": {
"text": "How likely are you to recommend whatsapp to a friend?"
},
"footer": {
"text": "Please make your selection"
},
"action": {
"button": "Answers",
"sections": [
{
"title": "Your score:",
"rows": [
{
"id": "001",
"title": "1"
},
{
"id": "002",
"title": "2"
}
]
}
]
}
}
}
{
"messages": [
{
"id": "669ea9e5d366ff7faaed4272",
"received": "2024-07-22T18:50:13.927Z",
"author": {
"avatarUrl": "https://www.gravatar.com/avatar/00000000000000000000000000000000.png?s=200&d=mm",
"type": "business"
},
"content": {
"type": "text",
"text": "{\"type\":\"list\",\"header\":{\"type\":\"text\",\"text\":\"CSAT Survey\"},\"body\":{\"text\":\"How likely are you to recommend whatsapp to a friend?\"},\"footer\":{\"text\":\"Please make your selection\"},\"action\":{\"button\":\"Answers\",\"sections\":[{\"title\":\"Your score:\",\"rows\":[{\"id\":\"001\",\"title\":\"1\"},{\"id\":\"002\",\"title\":\"2\"}]}]}}"
},
"source": {
"type": "api:conversations"
}
}
]
}
The provided YAML configuration below defines an API specification using the OpenAPI (formerly known as Swagger) format.