User Manual
Version 7.5
×

Add geofences

 
Example:
http://db.<address>/api/api.php?cmd=geofenceadd
 
Parameter:
cmd : geofenceadd
zonename: geofence name
zonetype: zone type (1 - polygon, 2 - circle)
color: zone color in HEX format ( #FFFFFF )
info: any text information
group_name: name of the geofence group. If it doesn't exist then it will be created (optional if group_id is given)
group_id: The ID of the group if you want to use a known group. (optional if group_name is set) If this parameter is set - group_name is ignored
geometry: GEOJson describing a polygon or a circle, depending on the type of geofence
external_id: external ID of the geofence (optional)
 
Request:
polygon
http://db.<address>/api/api.php?cmd=geofenceadd&zonetype=1&zonename=test_api_polygon&external_id=12354&info=blabla&color=%23FF3300&group_name=TEST_API&geometry={%22type%22:%22Polygon%22,%22coordinates%22 :[[[55.184334,25.112866],[55.183512,25.113472],[55.182154,25.112516],[55.183511,25.111016],[55.184923,25.112133]]]}
 
Answer:
{
     "code": 0,
     "message": "OK",
     "data": {
         "identifier": null,
         "zone name": null,
         "zone type": null,
         "external_id": null,
         "created_in": null,
         "updated_at": null,
         "color": null,
         "information": null,
         "group_id": null
     }
}