Use this API to send a Interactive CPR Message to a WhatsApp user.
The call permission request interactive object cannot be edited by the business. Only the message body can be customized.
Request Params
Key | Description | Values | Data Type | Required/Optional | Constraints |
---|---|---|---|---|---|
Headers | |||||
Authorisation | Access Token for the application | sk_8eb35b1f81c24af2xxxxxx | String | Required | Should be a valid Partner App Access Token. |
Path Params | |||||
App Id | App ID to fetch the access token | bf9ee64c-3d4d-4ac4-xxxx-732e577007c4 | String | Required | The Id should be a valid app Id of Gupshup |
Body JSON | |||||
messaging_product | Messaging product | String | Required | ||
recipient_type | Recipient type | individual | String | Required | |
to | Destination phone no where the message need to be send | 91785876xxxx | String | Required | Must be a valid phone number. |
type | Messaging type | interactive | String | Required | Type should be interactive to send interactive message. |
interactive | interactive message inside body |
| Object | Required | Key should be interactive to send text message. |
Sample request
curl --location 'https://partner.gupshup.io/partner/app/{{APP_ID}}/v3/message' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/json' \
--data '{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "91888899xxx",
"type": "interactive",
"interactive": {
"type": "call_permission_request",
"action": {
"name": "call_permission_request"
},
"body": {
"text": "We would like to call you to help support your query on Order No: ON-12853."
}
}
}'
Sample Response
{
"messages": [
{
"id": "GUPSHUP_MESSAGE_ID"
}
],
"messaging_product": "whatsapp",
"contacts": [
{
"input": "DESTINATION_PHONE_NO",
"wa_id": "DESTINATION_PHONE_NO"
}
]
}
Status codes
Status Code | Response | Comment |
---|---|---|
Success | ||
200 |
| |
Error | ||
401 |
| When API key authentication fails |
400 |
| |