User call permissions
Last update: 5 hours ago by Irais Aguirre
Integration summary
- Token: depends on the endpoint, in the
Authorization: Bearer <token>header — use{{wa-msg-api-token}}for messaging and{{admin-token}}for template creation (how to generate it)- Endpoints used on this page:
POST https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging(messaging token{{wa-msg-api-token}}): send the non-template message or the template messagePOST https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/template(admin token{{admin-token}}): create the templatetypevalues on this page:"interactive","template"
There are three ways to ask a user for permission to call them: with a non-template message, or by creating a template with the request and sending it as a template message.
Send a non-template message with a call permission request
To send a non-template message with a call permission request, use the
/messaging endpoint.Create a template with a call permission request
To create a template with a call permission request, use the /template endpoint and add the following to the structure object.
Body
Fields for Create a template with a call permission request, inside the structure object:
Structure object
| Name | Description | Type | Requirements |
|---|---|---|---|
| call_permission_request | Send true to add the call-permission-request button to the template. | Boolean | Optional |
Example
Complete Create a template with a call permission request example. This works for both MARKETING and UTILITY templates; change category and the body text accordingly.
HTTP request
curl -X POST 'https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/template' \-H 'Authorization: Bearer {{admin-token}}' \-H 'Content-Type: application/json' \-d '{"wba_id": "1234567899870","name": "utility_call_permission_request","language": "en_US","category": "UTILITY","structure": {"body": {"text": "Hi {{1}}, we would like to call you to assist with your recent order. Our support team is ready to help.","example": {"body_text": [["Pablo"]]}},"call_permission_request": true}}'
Body
{"wba_id": "1234567899870","name": "utility_call_permission_request","language": "en_US","category": "UTILITY","structure": {"body": {"text": "Hi {{1}}, we would like to call you to assist with your recent order. Our support team is ready to help.","example": {"body_text": [["Pablo"]]}},"call_permission_request": true}}
Send a template message with a call permission request
To send a message using the call permission request template, use the
/messaging endpoint and specify the template you created.