Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

twilio/location


Twilio/location type contains a location pin and an optional label, which can be used to enhance delivery notifications or connect recipients to physical experiences you offer.

(information)

Info

Location templates are only available once the end user is in a 24 hr session. They can not initiate a business initiated session.

Location templates are not supported for approval on WhatsApp and can't be submitted for approval.


Supported Channels

supported-channels page anchor

WhatsApp


Content API - Location sample.

longitude:

  • Type: numbers
  • Required: yes
  • Variable Support: no
  • Description: The longitude value of the location pin you want to send. Value must be between [-90.0, +90.0]

latitude:

  • Type: numbers
  • Required: yes
  • Variable Support: no
  • Description: The latitude value of the location pin you want to send. Value must be between [-180.0, +180.0]

label:

  • Type: string
  • Required: no
  • Variable Support: yes
  • Description: Label to be displayed to the end user alongside the location pin.

Create Location Template

create-location-template page anchor
curl

_17
curl -X POST 'https://content.twilio.com/v1/Content' \
_17
-H 'Content-Type: application/json' \
_17
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \
_17
-d '{
_17
"friendly_name": "location",
_17
"language": "en",
_17
"types": {
_17
"twilio/text": {
_17
"body": "Owl Air: Time to board, SFO is located at San Francisco International Airport, P.O. Box 8097, San Francisco, CA 94128 "
_17
},
_17
"twilio/location": {
_17
"latitude": 37.62159755922449,
_17
"longitude": -122.37888566473057,
_17
"label": "Time to Board @ SFO"
_17
}
_17
}
_17
}'

Output

_24
{
_24
"language": "en",
_24
"date_updated": "2022-08-29T15:23:12Z",
_24
"variables": null,
_24
"friendly_name": "locationtest",
_24
"account_sid": "ACXXXXXXXXXXXXXXXXXX",
_24
"url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXX",
_24
"sid": "HXXXXXXXXXXXXXXXXXXX",
_24
"date_created": "2022-08-29T15:23:12Z",
_24
"types": {
_24
"twilio/text": {
_24
"body": "Owl Air: Time to board, SFO is located at San Francisco International Airport, P.O. Box 8097, San Francisco, CA 94128 "
_24
},
_24
"twilio/location": {
_24
"latitude": 37.62159755922449,
_24
"longitude": -122.37888566473057,
_24
"label": "Time to Board @ SFO"
_24
}
_24
},
_24
"links": {
_24
"approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXX/ApprovalRequests",
_24
"approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp"
_24
}
_24
}


Rate this page: