Send MM Lite Messages (v3)

Endpoints

https://api.gupshup.io/wa/app/{appId}/v3/marketing/msg

Request Parameters

KeyDescriptionValueData TypesRequire/OptionalConstraints
apikeyApikey of the accountStringRequired- Should be a valid Gupshup App Access Token
appIdApp ID to fetch the access token{{App_ID}}StringRequired- The Id should be a valid app Id of Gupshup.
toto phone number where the message need to be sendStringRequiredMust be a valid phone no
templatemeta template payloadjsonRequiredThis endpoint only supports marketing template.
typeType in the value of what kind of message the user is sendingtemplateStringRequiredset it’s value as template
messaging_productMessaging product is a constant value i.e., whatsappwhatsappStringRequired

Sample Request

 curl --location '{{wa_base_url}}/wa/app/:appId/v3/marketing/msg' \
--header 'apikey: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "recipient_type": "individual",
    "messaging_product": "whatsapp",
    "to": "{{destination}}",
    "type": "template",
    "template": {
        "language": {
            "policy": "deterministic",
            "code": "en"
        },
        "namespace": "5ff5f84e_789b_44df_80dd_6844d48a6a4a",
        "name": "cc_temp_prod",
        "components": [
            {
                "type": "body",
                "parameters": []
            },
            {
                "type": "button",
                "sub_type": "copy_code",
                "index": "0",
                "parameters": [
                    {
                        "type": "coupon_code",
                        "coupon_code": "250FF"
                    }
                ]
            },
            {
                "type": "button",
                "sub_type": "url",
                "index": "1",
                "parameters": [
                    {
                        "type": "text",
                        "text": "summer2023"
                    }
                ]
            },
            {
                "type": "button",
                "sub_type": "url",
                "index": "2",
                "parameters": [
                    {
                        "type": "text",
                        "text": "summer2023"
                    }
                ]
            }
        ]
    }
}'

Response Parameters

KeyDescription
GUPSHUP_MESSAGE_IDUnique Message Id generated by gupshup for each message
DESTINATION_PHONE_NODestination phone no of the message sent

Sample Response

{
    "messages": [
        {
            "id": "b7347903-476e-4c01-83a0-f1390cf3c36e"
        }
    ],
    "messaging_product": "whatsapp",
    "contacts": [
        {
            "input": "9111111111",
            "wa_id": "9111111111"
        }
    ]
}

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
400{
"status": "error",
"message": ""MM lite is not enabled for this app"
}
When mmLite config is not enabled for the given app .
400{
"message": "Callback Billing must be enabled for this API",
"status": "error"
}
if Callback billing is not enabled for the app
400{
"message": "The provided app is not of the expected type for this API. Please ensure that the app is on cloud.",
"status": "error"
}
if the app is onPrem app instead of cloud
400{
"message": "Invalid App Details",
"status": "error"
}
if app details are not found
401{
"status": "error",
"message": "Authentication Failed"
}
When API key authentication fails

Receiving webhooks : All incoming DLRs should be received and forwarded as per the existing mechanism. Webhooks / DLR payload will be the same as existing on V2 and V3, no change. Except - delivered, sent, read and billing event will indicate the message category as marketing_lite.