Interactive Message

Use this API to send the interactive messages to WhatsApp users.

Meta Interactive List, Button, CTA_URL type Message Doc Link

Request Parameters

Key

Description

Value

Data type

Required/Optional

Constraints

Authorization

Access Token for the application

{{PARTNER_APP_TOKEN}}

String

Required

Should be a valid Partner App Access Token

appId

App ID to fetch the access token

{{APP_ID}}

String

Required

The ID should be a valid Gupshup app ID.

messaging_product

Messaging product

whatsapp

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

Add interactive body

"interactive": {Interavtive body}

Object

Required

  • Key should be interactive to send interactive message. interactive types will be button, list, cta_url.

Sample Request

curl --location --request POST 'https://partner.gupshup.io/partner/app/{{APP_ID}}/v3/message' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "{{WHATSAPP_USER_PHONE_NUMBER}}",
    "type": "interactive",
    "interactive": {
        "type": "button",
        "header": {
            "type": "{{TYPE}}"
        },
        "body": {
            "text": "{{BODY_TEXT}}"
        },
        "footer": {
            "text": "{{FOOTER_TEXT}}"
        },
        "action": {
            "buttons": [
                {
                    "type": "reply",
                    "reply": {
                        "id": "{{BUTTON_ID}}",
                        "title": "{{BUTTON_LABEL_TEXT}}"
                    }
                }
            ]
        }
    }
}'

Sample Response

{
    "messages": [
        {
            "id": "GUPSHUP_MESSAGE_ID"
        }
    ],
    "messaging_product": "whatsapp",
    "contacts": [
        {
            "input": "DESTINATION_PHONE_NO",
            "wa_id": "DESTINATION_PHONE_NO"
        }
    ]
}

Status Codes

Status CodeResponseComments
Success
200{ "messages": [ { "id": "GUPSHUP_MESSAGE_ID" } ], "messaging_product": "whatsapp", "contacts": [ { "input": "DESTINATION_PHONE_NO", "wa_id": "DESTINATION_PHONE_NO" } ] }`
Error
401{ "status": "error", "message": "Authentication Failed" }`When API key authentication fails
400{ "message": "Callback Billing must be enabled for this API", "status": "error" }`If Callback billing is not enabled for the app
400{ "message": "Invalid App Details", "status": "error" }`If app details are not found
Language
Click Try It! to start a request and see the response here!