post https://partner.gupshup.io/partner/app//onboarding/marketing/msg
Use this API to send MM Lite message.
Request Parameters
Key | Description | Value | Data Types | Require/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 app Id of Gupshup. - The App must be associated with the account that owns the PARTNER_APP_TOKEN being used. |
to | to phone number where the message need to be send | String | Required | Must be a valid phone no | |
template | meta template payload | json | Required | This endpoint only supports marketing template. | |
type | Type in the value of what kind of message the user is sending | String | Required | set it’s value as template | |
messaging_product | Messaging product is a constant value i.e., whatsapp | String | Required |
Sample Request
curl --location 'https://partner.gupshup.io/partner/app/07c7c72d-20e3-4ff9-a5a1-14d1186eeec8/onboarding/marketing/msg' \
--header 'Authorization: sk_8eb35b1f81c24af293a405164a392f30' \
--header 'Content-Type: application/json' \
--data '{
"recipient_type": "individual",
"messaging_product": "whatsapp",
"to": "918888998545",
"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"
}
]
}
]
}
}'
Sample Response
{
"messages": [
{
"id": "6ba08089-bdd1-487f-a29c-0c46056aa1f9"
}
],
"messaging_product": "whatsapp",
"contacts": [
{
"input": "918888998545Value",
"wa_id": "918888998545Value"
}
]
}
Status Codes
Status Code | Response | Comments |
---|---|---|
Success | ||
200 | { "messages": [ { "id": "6ba08089-bdd1-487f-a29c-0c46056aa1f9" } ], "messaging_product": "whatsapp", "contacts": [ { "input": "918888998545Value", "wa_id": "918888998545Value" } ] } | |
Error | ||
400 | { "status": "error", "message": "MM lite is not enabled for this app" } | |
400 | { "status":"error", "message":"Unauthorised access to the resource. Please review request parameters and headers and retry" } |