post https://api.gupshup.io/wa/api/v1/msg
cURL
curl --location 'https://api.gupshup.io/wa/api/v1/msg' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: {{APIKEY}}' \
--data-urlencode 'source={{SOURCE}}' \
--data-urlencode 'destination={{DESTINATION}}' \
--data-urlencode 'message={
"type": "location",
"longitude": "72.877655",
"latitude": "19.075983",
"name": "Gupshup",
"address": "101, Silver Metropolis, Bimbisar Nagar Rd, Bimbisar Nagar, Goregaon, Mumbai, Maharashtra 400063"
}' \
--data-urlencode 'src.name={{APP_NAME}}'Sample Request
curl --location 'https://api.gupshup.io/wa/api/v1/msg' \
--header 'accept: application/json' \
--header 'apikey: xvnwgh9vgbbl6gjeezymu5v5iepxq2zt' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'source=918097424541' \
--data-urlencode 'destination=91735824xxxx' \
--data-urlencode 'src.name=TedLasso' \
--data-urlencode 'message={
"type": "location",
"longitude": "72.877655",
"latitude": "19.075983",
"name": "Gupshup",
"address": "101, Silver Metropolis, Bimbisar Nagar Rd, Bimbisar Nagar, Goregaon, Mumbai, Maharashtra 400063"
}'Request Parameters
| Parameter | Location | Type | Description | Example |
|---|---|---|---|---|
| apikey | Header | string | APIKEY of your Gupshup Account | 61b3021c97214370b341f8baaae0xxxx |
Form Parameters (Request Body)
| 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 location details | See below for detailed structure |
message object structure:
message object structure:| Field | Type | Required | Default Value | Description |
|---|---|---|---|---|
| type | string | Yes | location | Type of session message (fixed value) |
| longitude | string | No | 72.877655 | Longitude of the location in decimals |
| latitude | string | No | 19.075983 | Latitude of the location in decimals |
| name | string | No | Gupshup | Name of the location |
| address | string | No | 101, Silver Metropolis, Bimbisar Nagar Rd, Bimbisar Nagar, Goregaon, Mumbai, Maharashtra 400063 | Caption for the message |
Status Codes
Status Code | Description | Response Body (application/json) |
|---|---|---|
200 | Successful response |
|
400 | Bad Request | Either: |
401 | Authentication Failed |
|
429 | Too Many Requests |
|
