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}}'
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"
}'
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 location details | See below for detailed 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 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" } |