Get objects count in the fence
Purpose
This endpoint list objects inside the fence.
Request data
HTTPS method: GET
- Constants and parameters enclosed in curly brackets { } must be replaced with their values.
- Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
URL request format
https://{baseURL}/geofencing/{versionNumber}/fences/{fenceId}/objects?key={Your_API_Key}&filters={property:value}&maxResults={integer}&pageNumber={integer}
curl command request format
curl 'https://{baseURL}/geofencing/{versionNumber}/fences/{fenceId}/objects?key={Your_API_Key}&filters={property:value}&maxResults={integer}&pageNumber={integer}'
Request parameters
The following table describes the parameters that can be used in a request.
- Required parameters must be used or the call will fail.
- Optional parameters may be used.
- The order of request parameters is not important.
- The maximum allowed time between provided timestamps is 24h.
Required parameters | Description |
---|---|
| The base URL for calling the API. |
| Service version. |
| An API Key valid for the requested service. |
| The fence id to gather details for. |
Optional parameters | Description |
---|---|
| Only used to select objects whose properties comply with the filter. |
| Maximum number of items returned in the response. |
| The number of the items page to be returned in the response. The maximum
number of elements on the page is equal to the |
Filters
Filters have their own syntax as described in the following table. Nested objects are not supported.
objectProperty:value
Operator name | Usage | Explanation | Example |
---|---|---|---|
|
| Select only objects with property <property_name> set to value <property_value> |
|
Response data
Response body
The following JSON code block demonstrates a successful response from the API server.
1{2 "summary": {3 "id": "fence_id",4 "name": "fence_name"5 },6 "objects": [7 {8 "id": "object_uuid",9 "name": "object_name"10 }11 ],12 "totalObjectsCount": "number",13 "resultInfo": {14 "maxResults": "number",15 "pageNumber": "number",16 "itemsCount": "number"17 }18}
Response fields
The following table describes all of the response fields.
Primary fields | |
---|---|
Field | Description |
| Contains information about the list objects in the fence request. |
| An array of objects located in the fence. |
| The number of the objects inside the fence. |
| Contains information about response paging. |
summary object | |
Field | Description |
| UUID of a fence for which this report is generated. |
| The name of a fence for which this report is generated. |
object object | |
Field | Description |
| UUID of the object which is inside the fence. |
| The name of the object. |
resultInfo object | |
Field | Description |
| Maximum number of items returned in the response. |
| Number of the items page to be returned in the response. Maximum number
of elements on the page is equal to the |
| Number of returned items on the page. |
Response codes
Code | Meaning & possible causes |
---|---|
| OK |
| Bad Request:
|
| Not found: No such fence. |
Example
Get objects count in the fence. Get the object number of the 'House' fence** (id: 66080bab-d69d-420a-ac2b-90c71894ac8f) and with property 'type' and value 'drone'.
URL rerquest example
https://api.tomtom.com/geofencing/1/fences/66080bab-d69d-420a-ac2b-90c71894ac8f/objects?key={Your_API_Key}&filters=type:drone
Response body example
1{2 "summary": {3 "id": "66080bab-d69d-420a-ac2b-90c71894ac8f",4 "name": "House"5 },6 "objects": [7 {8 "id": "299c4fc7-a611-46a3-9d03-7b3966f225ba",9 "name": "Drone #1"10 }11 ],12 "totalObjectsCount": 1,13 "resultInfo": {14 "maxResults": 100,15 "pageNumber": 1,16 "itemsCount": 117 }18}