curl --location 'https://api.gupshup.io/wa/api/v1/msg' \
--header 'Cache-Control: no-cache' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: jmtbjhggz51q0ln09cy3krbfqchbo4zc' \
--header 'cache-control: no-cache' \
--data-urlencode 'source=918097424542' \
--data-urlencode 'destination=917358246501' \
--data-urlencode 'message={
"type": "list",
"title": "Welcome to Gupshup 🐶🙂",
"body": "body text 😇🙂",
"msgid": "list1",
"globalButtons": [
{
"type": "text",
"title": "Options "
}
],
"items": [
{
"options": [
{
"type": "text",
"title": "section 1 row 1📍🙂",
"description": "first row of first section description 🙂😇",
"postbackText": "section 1 row 1 postback payload"
},
{
"type": "text",
"title": "section 1 row 2🙂",
"description": "second row of first section description 🙂🐶",
"postbackText": "section 1 row 2 postback payload "
},
{
"type": "text",
"title": "section 1 row 3 🙂",
"description": "third row of first section description 🙂😇",
"postbackText": "section 1 row 3 postback payload"
}
]
}
]
}' \
--data-urlencode 'src.name=TraditionalCheck'
Parameter | Location | Type | Description | Example |
---|
apikey | Header | string | APIKEY of your Gupshup Account | 61b3021c97214370b341f8baaae0xxxx |
Parameter | Type | Required | Description | Example |
---|
source | integer | Yes | Source Phone Number | 918929874278 |
destination | integer | Yes | Destination Phone Number | 918805162043 |
src.name | string | Yes | App Name | august18 |
message | object | Yes | Message object containing list details | See below for detailed structure |
Field | Type | Required | Description | Example |
---|
type | string | Yes | Type of the message | list |
title | string | Yes | Header text of the message | Header text of the message |
body | string | Yes | Body content of the message | This the the body of the message |
msgid | string | Yes | Identifier of the message | IDENTIFIER_ID |
globalButtons | array | No | Array of global button objects | See globalButton structure below |
items | array | No | Array of item objects | See item structure below |
Field | Type | Description | Example |
---|
type | string | Type of title | text |
title | string | Title of the button | options |
Field | Type | Description | Example |
---|
options | array | Array of option objects | See option structure below |
Field | Type | Required | Description | Example |
---|
type | string | Yes | Type of the option | text |
title | string | Yes | Row's title | section 1 row 1📍🙂 |
description | string | Yes | Row's description | first row of first section description 🙂😇 |
postbackText | string | Yes | Row's postback payload | section 1 row 1 postback payload |
encodeText | boolean | No | Indicates whether to encode the title's content | true |
Status Code | Description | Response Body (application/json) |
---|
200 | Successful response | { "status": "submitted", "messageId": "183dc8f1-7ecc-4419-895f-04fd0b1bfe07" } |
400 | Bad Request | Either:
{ "message": "Invalid Destination", "status": "error" } or { "message": "Invalid App Details", "status": "error" } |
401 | Authentication Failed | { "message": "Authentication Failed", "status": "error" } |
429 | Too Many Requests | { "message": "Too Many Requests", "status": "error" } |