geofence.create
The geofence.create command is used to create a new geofence.
TR50 Request
// Polygonal Geofence
{
"cmd": {
"command": "geofence.create",
"params": {
"key": "mygeofence",
"name": "My Geofence",
"points": [
[
26.409196,
-80.171016
],
[
26.420419,
-80.06596
],
[
26.321681,
-80.074886
]
],
}
}
}
// Radial Geofence
{
"cmd": {
"command": "geofence.create",
"params": {
"key": "mygeofence",
"name": "My Geofence",
"points": [
[
26.394916,
-80.112571
]
],
"radius": 0.5
}
}
}
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
name |
String |
Yes |
The name of the geofence. |
key |
String |
Yes |
The key of the geofence. |
points |
Array |
Yes |
One point for Radial, three to ten points for Polygonal. A point is an array consisting of two floats: [latitude, longitude] |
radius |
Float |
|
Only required for Radial geofences. The unit is kilometers. |
tags |
Array |
|
An array of tags to be assigned to the geofence. |
TR50 Response
If the command is sent successfully a success message is returned. Otherwise, an error and error message will be returned.
{
"cmd": {
"success": true
}
}