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

Messages that open a WhatsApp Flow. To create and manage Flows, see the Flows section. They are sent with POST /v1/messaging; headers, common fields and the response are in HTTP connection.

WhatsApp Flows

The type field must be "interactive" and the message content is sent in the flow object. See the general structure of interactive messages.

Body

Fields for WhatsApp Flows:

NameDescriptionTypeRequirements
flowObject with the WhatsApp Flow. Send only one: listMessages, replyButtons or flow (or another interactive message type).ObjectConditional

Flow object

NameDescriptionTypeRequirements
bodyThe message content.StringRequired
actionThe action you want the user to take after reading the message.ObjectRequired

Action object

NameDescriptionTypeRequirements
nameAction name. The service always sends "flow".StringOptional
parametersFlow parameters.ObjectRequired

action.parameters object

NameDescriptionTypeRequirements
modeThe flow can be in one of these modes:
  • draft
  • published
String
  • Optional.
  • Default: "published"
flow_message_versionFlow message version. The service always sends "3", whatever value you pass.String
  • Optional.
  • Always sent as "3".
flow_idUnique Flow ID provided by WhatsApp.StringRequired.
flow_tokenToken your business generates to identify the Flow session. It is returned in the Flow response.StringOptional.
flow_ctaCall to action button text, for example, "Sign up".String
  • Required
  • Character limit: 20 characters (no emojis).
flow_action
  • navigate: Predefines the first screen as part of the message.
  • data_exchange: For advanced use cases where your endpoint provides the first screen.
String
  • Required.
  • Possible values: "navigate" or "data_exchange".
flow_action_payloadObjectRequired if flow_action is "navigate". Otherwise, omit it.

flow_action_payload object

NameDescriptionTypeRequirements
screenID of the screen shown first.StringMust be an entry screen.
dataOptional input data for the Flow's first screen. If provided, it must be a non-empty object.Map<String, Object>Optional

Example

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

WhatsApp Flows HTTP request

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",
"flow": {
"body": "Book a WhatsApp API consulting session with one of our Concepto Móvil agents to get familiar with our solutions",
"action": {
"name": "flow",
"parameters": {
"mode": "draft",
"flow_message_version": "3",
"flow_id": "1",
"flow_token": "AQAAAAACS5FpgQ_cAAAAAD0QI3s.",
"flow_cta": "Book now",
"flow_action": "navigate",
"flow_action_payload": {
"screen": "screen name",
"data": {
"product_name": "name",
"product_description": "description",
"product_price": 100
}
}
}
}
}
}'

WhatsApp Flows body

{
"from": "5215500000001",
"to": "5215500000002",
"type": "interactive",
"flow":
{
"body": "Book a WhatsApp API consulting session with one of our Concepto Móvil agents to get familiar with our solutions",
"action": {
"name": "flow",
"parameters": {
"mode": "draft",
"flow_message_version": "3",
"flow_id": "1",
"flow_token": "AQAAAAACS5FpgQ_cAAAAAD0QI3s.",
"flow_cta": "Book now",
"flow_action": "navigate",
"flow_action_payload": {
"screen": "screen name",
"data": {
"product_name": "name",
"product_description": "description",
"product_price": 100
}
}
}
}
}
}


Previous
Contact information request
Next
Location request