List the fences for a given project
Service version: 1
Last edit: 2019.10.21
On this page
- ▸ Purpose
- ▸ Request data
Purpose
This endpoint:
- Obtains a list of tuples representing a user's fences for a given project.
- Each tuple contains a single fence UUID and name.
Request data
HTTPS method: GET
URL format
For ease of viewing and identification:
- Required constants and parameters are shown in bold text.
- Optional parameters are shown in plain text.
https://baseURL/geofencing/versionNumber/projects/projectId/fences?key=Your_API_Key
curl command
curl 'https://baseURL/geofencing/versionNumber/projects/projectId/fences?key=Your_API_Key'
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.
- If there is a default value that will be assumed when an optional parameter is not used, it is shown in the table.
- The order of request parameters is not important.
Required parameters | |
---|---|
Parameter | Description |
baseURL string |
The base URL for calling the API. Value: api.tomtom.com
|
versionNumber string |
Service version number. Value: 1
|
key string |
An API Key valid for the requested service. Value: Your valid API Key .
|
projectId string |
The project id to gather details for. Value: UUID
|
Optional parameters | |
This endpoint does not have any optional parameters. |
Response data
Response body
The following JSON code block demonstrates a successful Response from the API server.
{
"fences": [
{
"id": ,
"name":
}
...
]
}
Response fields
The following table describes all of the fields that can appear in a Response.
Primary fields | |
---|---|
Field | Description |
fences[] array |
The list of fences in a project. |
fences[] array |
|
Field | Description |
id string |
The UUID of the fence. |
name string |
The fence's name. |
Examples
List all fences of the 'Cities in the Netherlands' (id: 44de824d-c368-46cf-a234-a6792682dfd6) project.
Request URL
https://api.tomtom.com/geofencing/1/projects/44de824d-c368-46cf-a234-a6792682dfd6/fences?key=Your_API_Key
Response body
{
"fences": [
{
"id": "f44405b40-5ebc-4aba-8f74-0b818d0a7e8a",
"name": "Amsterdam"
},
{
"id": "07c2994b-4f90-4bd5-95de-46b00bda28ed",
"name": "Pune"
},
{
"id": "30cf3728-5328-47d5-8a0f-91b2fca70fbb",
"name": "Lodz"
},
{
"id": "56d3887a-ac76-4089-9451-39d4ea340744",
"name": "Berlin"
}
]
}