Query Multiple Private Geofences

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

Query multiple private geofences based on the monitored devices.

API address

GET: /v2.0/iot-01/fences/private/batch

Request parameter

Parameter name Type IN Required Description
entity_ids String query true One or more IDs of the monitored objects, separated with commas (,). Maximum value: 50.
coord_type_output String query false Indicates the type of the longitude and latitude positioning coordinate system. Valid values:
  • WGS84: Google Coordinate System.
  • GCJ02: AutoNavi.
  • BD09LL: Baidu.
  • Empty value: Defaults to AutoNavi for China data center, and Google for other data centers.

Return parameter

Parameter name Type Description
result List

Description of result

Parameter name Type Description
fence_id Long The geofence ID.
fence_name String The name of the geofence.
bind_type Integer The binding type of the geofence. Set the value to 1 to represent a private geofence.
entity_id String The ID of a monitored object.
shape String Indicates the shape of the geofence. Valid values:
  • circle: The geofence is circular.
  • polygon: The geofence is polygonal.
fence_data FenceShapeDataRes The data points (DPs) of a geofence.
warn_rule Integer 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.
enable Integer Indicates whether the geofence is enabled. Valid values:
  • 0: disabled.
  • 1: enabled.

Description of fence_data

Parameter name Type Description
circle CircleDataRes The data of a circular geofence.
polygon List The data of a polygonal geofence.

Description of polygon

Parameter name Type Description
lon Double The longitude of a polygonal point.
lat Double The latitude of a polygonal point.

Description of circle

Parameter name Type Description
radius Integer The radius of a geofence. Unit: meters.
lon Double The longitude of a geofence center point.
lat Double The latitude of a geofence center point.

Request example

GET: /v2.0/iot-01/fences/private/batch?entity_ids=vdevo16245017293****

Return example

{ "result": [ { "shape": "circle", "fence_data": { "circle": { "lon": 31.218, "radius": 300, "lat": 121.3604 } }, "entity_id": "vdevo16245017293****", "bind_type": 1, "fence_id": 44009, "fence_name": "The First Geofence", "enable": 1, "warn_rule": 1 } ], "t": 1625225444154, "success": true }

Error code

For more information, see error code.