Delete fence from project
Service version: 1
Last edit: 2019.09.18
On this page
- ▸ Purpose
- ▸ Request data
Purpose
This endpoint provides a command used to delete a fence from a project. If the project is the only one the fence is in, the fence is permanently deleted.
Request data
HTTPS method: DELETE
URL format
For ease of viewing and identification:
- Required constants and parameters are shown in bold text.
- Optional parameters are shown in plain text.
DELETE https://baseURL/geofencing/versionNumber/projects/projectId/fences/fenceId?key=Your_API_Key&adminKey=Your_Admin_Key&dryRun=true/false
curl command
curl -XDELETE 'https://baseURL/geofencing/versionNumber/projects/projectId/fences/fenceId?key=Your_API_Key&adminKey=Your_Admin_Key&dryRun=true/false'
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 .
|
adminKey string |
An Admin Key valid for the provided API Key. Value: Your valid Admin Key .
|
projectId string |
The project id used to delete a fence. Value: A UUID
|
fenceId string |
The fence id to delete. Value: A UUID
|
Optional parameters | |
Parameter | Description |
dryRun boolean |
Simulates fence removal without actually deleting anything. The service just sends the Response, containing the affected projects. Default value: false
Other value: true |
Response data
Response body
{
"name": "fence_name",
"id": "fence_id",
"dryRun" : true/false,
"removedRelationsToProjects": [
{
"id": "project_1R_id",
"name": "project_1R_name"
}
]
"remainingRelationToProjects": [
{
"id": "project_1N_id",
"name": "project_1N_name"
},
... ,
{
"id": "project_NN_id",
"name": "project_NN_name"
}
]
}
Response fields
The following table describes all of the Response fields.
Primary fields | |
---|---|
Field | Description |
name string |
The name of the fence. |
id string |
The UUID of the fence. |
dryRun boolean |
Indicates if the output is for the non-delete Request (true), or the changes were actually made (false). |
removedRelationsToProjects[] array |
(Optional) The list of projects the fence was unlinked from. |
remainingRelationToProjects[] array |
(Optional) The list of projects the fence remains linked to. |
removedRelationsToProjects[] array |
|
Field | Description |
id string |
The UUID of a project. |
name string |
The name of a project. |
remainingRelationToProjects[] array |
|
Field | Description |
id string |
The UUID of a project. |
name string |
The name of a project. |
HTTPS Response codes
Code | Meaning and possible causes |
---|---|
200 |
OK: (for dry run mode) Deleted |
403 |
Forbidden:
|
404 |
Not found:
|
Examples
Request URL
https://api.tomtom.com/geofencing/1/projects/aaab6d78-1738-45bd-a78b-ff3a7ba839f3/fences/d4db1c28-c753-4d70-8087-dabfbf4d68d2?key=Your_API_Key&adminKey=Your_Admin_Key&dryRun=true
Response body (JSON)
{ "name": "No-fly zone 23", "id": "aaab6d78-1738-45bd-a78b-ff3a7ba839f3", "dryRun" : true, "removedRelationsToProjects": [{ "id": "d4db1c28-c753-4d70-8087-dabfbf4d68d2", "name": "Project1" }], "remainingRelationToProjects": [{ "id": "b77e834c-7ef3-41d9-adeb-f1e68f8a4ae0", "name": "Project2" }] }