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) andtype(details)typevalues 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:
| Name | Description | Type | Requirements |
|---|---|---|---|
| type | The value is "action". | String | Required |
| action | The action you want the user to take after reading the message. | Object | Required |
Action object
| Name | Description | Type | Requirements |
|---|---|---|---|
| flow_token | A token generated by the business that serves as an identifier. | String | Required |
| flow_action_data | Optional 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):
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}}}]}]}}
