Delete fence from project
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
- 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}/projects/{projectId}/fences/{fenceId}?key={Your_API_Key}&adminKey={Your_Admin_Key}&dryRun={true/false}
curl command request format
curl -XDELETE 'ttps://{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.
- The order of request parameters is not important.
Required parameters | Description |
---|---|
| The base URL for calling the API. |
| Service version number. |
| An API Key valid for the requested service. |
| An Admin Key valid for the provided API Key. |
| The project id used to delete a fence. |
| The fence id to delete. |
Optional parameters | Description |
---|---|
| Simulates fence removal without actually deleting anything. The service
just sends the response, containing the affected projects. |
Response data
Response body
1{2 "name": "fence_name",3 "id": "fence_id",4 "dryRun" : true/false,5 "removedRelationsToProjects": [6 {7 "id": "project_1R_id",8 "name": "project_1R_name"9 }10 ]11 "remainingRelationToProjects": [12 {13 "id": "project_1N_id",14 "name": "project_1N_name"15 },16 ... ,17 {18 "id": "project_NN_id",19 "name": "project_NN_name"20 }21 ]22}
Response fields
The following table describes all of the response fields.
Primary fields | |
---|---|
Field | Description |
| The name of the fence. |
| The UUID of the fence. |
| Indicates if the output is for the non-delete request (true), or the changes were actually made (false). |
| (Optional) The list of projects the fence was unlinked from. |
| (Optional) The list of projects the fence remains linked to. |
removedRelationsToProjects array | |
Field | Description |
| The UUID of a project. |
| The name of a project. |
remainingRelationToProjects array | |
Field | Description |
| The UUID of a project. |
| The name of a project. |
Response codes
Code | Meaning & possible causes |
---|---|
| OK: (for dry run mode) Deleted |
| Forbidden:
|
| Not found:
|
Example
Delete a fence from a project.
URL request example
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 example
1{2 "name": "No-fly zone 23",3 "id": "aaab6d78-1738-45bd-a78b-ff3a7ba839f3",4 "dryRun": true,5 "removedRelationsToProjects": [6 {7 "id": "d4db1c28-c753-4d70-8087-dabfbf4d68d2",8 "name": "Project1"9 }10 ],11 "remainingRelationToProjects": [12 {13 "id": "b77e834c-7ef3-41d9-adeb-f1e68f8a4ae0",14 "name": "Project2"15 }16 ]17}