Save Circular Private Geofences

Last Updated on : 2023-06-15 04:57:24

Save multiple circular private geofences. A maximum of 100 private geofences can be created for one object.

API address

POST: /v2.0/iot-01/fences/circle/private/batch

Request parameter

Description of body

Parameter name Type IN Required Description
circle_private_fences List true The request of saving circular private geofences.

Description of circle_private_fences

Parameter name Type IN Required Description
tag String false The dimension tag.
fence_id Long false The ID of a geofence. Update an existing one, or create one geofence ID if none is available.
fence_name String true The name of a geofence, with up to 50 characters.
entity_id String true The ID of a monitored object.
radius Integer true The radius of a geofence. Unit: meters. Valid values: (0,5000].
lon Double true The longitude of a geofence center point.
lat Double true The latitude of a geofence center point.
coord_type String true Indicates the type of the longitude and latitude positioning coordinate system. Valid values:
  • WGS84: Google Coordinate System.
  • GCJ02: AutoNavi.
  • BD09LL: Baidu.
warn_rule Integer true Indicates the alert rules. Valid values:
  • 1: triggers an alert when someone enters the geofence.
  • 2: triggers an alert when someone exits the geofence.
  • 3: triggers an alert when someone enters or exits the geofence.

Return parameter

Parameter name Type Description
result List

Description of result

Parameter name Type Description
fence_id Long The geofence ID.
entity_id String The ID of a monitored object.

Request example

POST: /v2.0/iot-01/fences/circle/private/batch
{ "circle_private_fences": [ { "fence_name": "The First Private Geofence in Batches", "bind_type": 1, "entity_id": "vdevo16245017293****", "radius": 200000, "lon": "31.218093093844796", "lat": "121.36040929664462", "coord_type": "WGS84", "warn_rule": 1 } ] }

Return example

{ "result": [ { "entity_id": "vdevo16245017293****", "fence_id": 53001 } ], "t": 1625221020596, "success": true }

Error code

For more information, see error code.