Location

Location Object

The location map gives details about the user's current location (geo location co-ordinates such as latitude, longitude) . This parameter works in association with each respective client's location access settings. The value for the status key in the location map changes according to the location settings. The status key can have the following values:

KeyValue
statusgranted
prompt
denied
failed

Sample response when status is granted

If the location access is enabled, the response will contain the latitude and longitude of the user ( who's executing the command / interacting with the bot / using a message action ) 


{
 "latitude": 12.8282472,
 "accuracy": 30,
 "status": "granted",
 "longitude": 80.0511901
}

Sample response when status is prompt

This response will be received when the client's location access is enabled but Cliq has not yet been granted access to detect the location. 


{
 "status": "prompt"
}

 

Quick Tip:

You can use a instant button with the system api: locationpermission, on your handler execution. When a user clicks on the instant button, the browser prompt for location access is displayed.

Sample Syntax: [Button Label](system.api | locationpermission)

Sample response when status is denied

This response is received when the client's location setting is disabled. In this case, user will have to manually enable it. 


{
 "status": "denied"
}

Sample response when status is failed

This response is received when Cliq is not able to access your location settings due to technical issues. 


{
 "status": "failed"
}

 

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocliq.com