logo
enes

WhatsApp Flows

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: "template"
  • Response: the same for every message (see response)

Templates that open a WhatsApp Flow. 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.

WhatsApp Flows

Template that opens a WhatsApp Flow from a button. In the parameter object, type must be "action".

Body

Fields for WhatsApp Flows:

NameDescriptionTypeRequirements
typeThe value is "action".StringRequired
actionThe action you want the user to take after reading the message.ObjectRequired

Action object

NameDescriptionTypeRequirements
flow_tokenA token generated by the business that serves as an identifier.StringRequired
flow_action_dataOptional input data for the first screen of the Flow. If provided, it must be a non-empty object.Map<String, Object>Optional

Example

Complete WhatsApp Flows example (HTTP request and JSON body):

HTTP request with body and 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": "template",
"template": {
"language": "en_US",
"name": "FLOW_TEMPLATE",
"components": [
{
"type": "body",
"parameters": [
{
"text": "This is a flows as template demo",
"type": "text"
}
]
},
{
"type": "button",
"subtype": "flow",
"index": 0,
"parameters": [
{
"type": "action",
"action": {
"flow_token":"AQAAAAACS5FpgQ_cAAAAAD0QI3s.",
"flow_action_data": {
"product_name": "name",
"product_description": "description",
"product_price": 100
}
}
}
]
}
]
}
}'

Body with text header

{
"from": "5215500000001",
"to": "5215500000002",
"type": "template",
"template": {
"language": "en_US",
"name": "FLOW_TEMPLATE",
"components": [
{
"type": "body",
"parameters": [
{
"text": "This is a flows as template demo",
"type": "text"
}
]
},
{
"type": "button",
"subtype": "flow",
"index": 0,
"parameters": [
{
"type": "action",
"action": {
"flow_token":"AQAAAAACS5FpgQ_cAAAAAD0QI3s.",
"flow_action_data": {
"product_name": "name",
"product_description": "description",
"product_price": 100
}
}
}
]
}
]
}
}


Previous
Buttons
Next
Carousel