List

cURL

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'

Request Parameters

ParameterLocationTypeDescriptionExample
apikeyHeaderstringAPIKEY of your Gupshup Account61b3021c97214370b341f8baaae0xxxx

Form Parameters (Request Body)

ParameterTypeRequiredDescriptionExample
sourceintegerYesSource Phone Number918929874278
destinationintegerYesDestination Phone Number918805162043
src.namestringYesApp Nameaugust18
messageobjectYesMessage object containing list detailsSee below for detailed structure

message object structure:

FieldTypeRequiredDescriptionExample
typestringYesType of the messagelist
titlestringYesHeader text of the messageHeader text of the message
bodystringYesBody content of the messageThis the the body of the message
msgidstringYesIdentifier of the messageIDENTIFIER_ID
globalButtonsarrayNoArray of global button objectsSee globalButton structure below
itemsarrayNoArray of item objectsSee item structure below

globalButton object structure:

FieldTypeDescriptionExample
typestringType of titletext
titlestringTitle of the buttonoptions

item object structure:

FieldTypeDescriptionExample
optionsarrayArray of option objectsSee option structure below

option object structure:

FieldTypeRequiredDescriptionExample
typestringYesType of the optiontext
titlestringYesRow's titlesection 1 row 1📍🙂
descriptionstringYesRow's descriptionfirst row of first section description 🙂😇
postbackTextstringYesRow's postback payloadsection 1 row 1 postback payload
encodeTextbooleanNoIndicates whether to encode the title's contenttrue

Status Codes

Status CodeDescriptionResponse Body (application/json)
200Successful response{ "status": "submitted", "messageId": "183dc8f1-7ecc-4419-895f-04fd0b1bfe07" }
400Bad RequestEither:
{ "message": "Invalid Destination", "status": "error" }
or
{ "message": "Invalid App Details", "status": "error" }
401Authentication Failed{ "message": "Authentication Failed", "status": "error" }
429Too Many Requests{ "message": "Too Many Requests", "status": "error" }
Language
Click Try It! to start a request and see the response here!