Send Catalog Message
curl --location --request POST 'https://api.gupshup.io/wa/api/v1/msg' \
--header 'apikey: {{api_key}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'source={{source}}' \
--data-urlencode 'src.name={{srcname}}' \
--data-urlencode 'destination={{destination}}' \
--data-urlencode 'message={
"type": "product_details",
"subType": "catalog_message",
"body": {
"text":"body content!"
},
"footer": {
"text":"footer content!"
},
"thumbnailId": "{{product_retailer_id}}"
}' \
--data-urlencode 'channel=whatsapp' \
--data-urlencode 'disablePreview=true'
Meta Payloads Example
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "<receipientPhoneNumber>",
"type": "interactive",
"interactive" : {
"type" : "catalog_message",
"body" : {
"text": "Thanks for your order! Tell us what address you’d like this order delivered to."
},
"action": {
"name": "catalog_message",
"parameters": { // *Optional
"thumbnail_product_retailer_id": "<Product-retailer-id>"
}
}
}
}
Response
Status Code | Response | Comment |
---|---|---|
Success 200 | { "status": "submitted", "messageId": "4bed9a90-9f7a-4584-be5b-8ee1cba61a01" } | |
Error 401 | { "message": { "message": "Authentication Failed" }, "status": "error" } | When APIKey authentication fails or apikey is not sent |
Request Parameters
Key | Description | Constraints |
---|---|---|
apikey | Apikey of the account where the app is to be created | Should be a valid gupshup.io apikey |
source | Source Phone Number | |
src.name | Source App Name | |
destination | Destination phone number | |
message | Catalog message payload | |
channel | Channel to send messages to | - Must be WhatsApp |
disablePreview | Whether to disable preview of url |
Message Payloads
Key | Description | Constraints |
---|---|---|
type | Message type | Should be product_detailsfor product messages |
sub_type | Message Sub Type | Should be product_detailsfor product messages |
body | Message Body Content | |
footer | Message Footer content | Optional |
thumbnailId | Product Id to be shown as Thumbnail for catalog | Should contain valid product IDs from the catalog connected to Waba |
Updated 11 months ago