Save Polygonal Private Geofences

Last Updated on : 2023-06-20 14:52:24download

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

API address

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

Request parameter

Description of body

Parameter name Type IN Required Description
polygon_private_fence_reqs List true The request of saving polygonal private geofences.

Description of polygon_private_fence_reqs

Parameter name Type IN Required Description
tag String false The custom dimension tag to classify the geofences. The geofences can be filtered by the dimension tags.
fence_id Long false The ID of a geofence. Update the geofence attribute if the ID already exists, or create one geofence ID if none is available.
entity_id String true The device ID.
fence_name String true The name of the geofence.
vertexes String true The coordinates of the vertices of the polygon, including the latitude and longitude. The number of vertices ranges from 3 to 50.
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/polygon/private/batch
{ "polygon_private_fence_reqs": [ { "tag": "ceshi", "fence_name": "The Second Polygonal Geofence", "bind_type": 1, "entity_id": "vdevo162450172934170", "vertexes": "30,120;31,121;29,120", "coord_type": "WGS84", "warn_rule": 1 } ] }

Return example

{ "result": [ { "entity_id": "vdevo16245017293****", "fence_id": 53002 } ], "t": 1625221372592, "success": true }

Error code

For more information, see error code.