Location

Use this API to send messages with the Location template.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Request Parameters

KeyDescriptionValueData typeRequired/OptionalConstraints
AuthorizationAccess Token for the application{{PARTNER_APP_TOKEN}}StringRequiredShould be a valid Partner App Access Token
srcSource Phone Number{{SOURCE}}IntegerRequired
sandboxBoolean value{SANDBOX}BooleanOptional
destinationDestination Phone Number{{DESTINATION}}IntegerRequired
messageMessage Json{ "recipient_type": "individual", "preview_url": false, "to": "919970754444", "type": "location", "location":{ "name":"R. 7 de Abril - República", "address":"São Paulo - SP, Brazil", "longitude":-46.6444751,"latitude":-23.5463588 }, "caption":"The location for the event is Hadapsar,Pune", "channel": "whatsapp" }StringRequired
APP_IDApp ID to fetch the access token{{APP_ID}}StringRequired
  • The Id should be a valid app Id of Gupshup. - The App must be associated with the account that owns the PARTNER_APP_TOKEN being used.
userIdBSUID{{userId}}

Sample Request

curl --location 'https://partner.gupshup.io/partner/app/07c7c72d-20e3-4ff9-a5a1-14d1186eeec8/template/msg' \
--header 'Connection: keep-alive' \
--header 'Authorization: sk_8eb35b1f81c24af293a405164a392f30' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'source=917835039205' \
--data-urlencode 'sandbox=false' \
--data-urlencode 'destination=919970754444' \
--data-urlencode 'template={"id": "f7163aa4-b0fa-4a4e-8478-13d75e08ed4a","params": []}' \
--data-urlencode 'src.name=PartnerPortal' \
--data-urlencode 'userId={{BSUID}}' \
--data-urlencode 'message={"type":"LOCATION","LOCATION":{\"example\":\"The place for the event is kothrud,Pune\"}}'	

Sample Response

{
    "status": "submitted",
    "messageId": "d255d161-2d9e-455a-8776-9f64d0291e36"
}	

Status Codes

Status CodeResponseComments
Success
200{ "status": "submitted", "messageId": "d255d161-2d9e-455a-8776-9f64d0291e36" }
Error
429{ "status": "error", "message": "Too Many Requests" }10 Requests per Minute
500{ "status": "error", "message": "Internal server error. Please try again later. If the issue still persists, then contact Gupshup Dev Support" }For any Internal Error

Path Params
string
required

Unique identifier of the app.

Form Data
string
required

Message Json

boolean

Boolean Value

integer
required

Source Phone Number

Headers
string
required

Your app token, please refer Get access token api to get the token from partner documentation.

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json