Query Objects in Geofence

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

Query objects monitored by a geofence on pages.

API address

GET: /v2.0/iot-01/fences/{fence_id}/entity

Request parameter

Parameter name Type IN Required Description
fence_id Long uri true The geofence ID.
page_index Integer query false The page index. Default value: 1.
page_size Integer query false The number of entries returned on each page. Default value: 50.
last_row_key Long query false The last row key. Choose page_index or last_row_key.
last_row_key: Query only the next page at a high speed. The value is not returned if the first page is queried.
page_index: Query the specified page. The speed is low in the case of querying a huge amount of data.

Return parameter

Parameter name Type Description
result PageRes

Description of result

Parameter name Type Description
data List The list of entries on the current page.
total Long The total number of entries.
last_row_key Long The row key of the last entry on the current page.
last_page Boolean Indicates whether the current page is the last one. Valid values: true: yes. false: no.

Description of data

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

Request example

GET: /v2.0/iot-01/fences/54001/entity?pageIndex=1&pageSize=50

Return example

{ "result": { "last_row_key": 2000, "data": [ { "entity_id": "vdevo162450172934170" } ], "last_page": true, "total": 1 }, "t": 1625629758834, "success": true }

Error code

For more information, see error code.