Delete projects
Service version: 1
Last edit: 2019.09.18
On this page
- ▸ Purpose
- ▸ Request data
Purpose
This endpoint uses a command to delete projects.
- Delete is a cascade action, as no fence can exist without a project.
- if any fence would violate this rule after deleting a project, it will also be deleted.
- Information about all deleted fences will be sent in the Response.
Additional Response fields:
deletedFences
:- A Response field containing all deleted fences.
- Fences that are assigned to the project being deleted, but which also have a relationship to other projects, are not deleted.
- Only their relationship to the deleted project is removed.
removedRelationsToFences
:- A Response field containing all fences which are not deleted, but whose relationship to the deleted project is deleted.
removedRelationsToObjects
:- A Response field containing all objects which are not deleted, but whose relationship to the deleted project is deleted.
- Unlike fences, objects can exist without a default project.
- So, deleting their default project does not automatically delete them.
The delete command can also be used in dry run mode, which removes nothing, but sends information about cascade removals in the Response.
Project deletion takes place via the following steps.
- Delete every fence that only exist in the project being deleted; relationships are also removed.
- Remove relations to fences that exist in other projects.
- Remove relations to objects that have the deleted project set as their default project.
- Delete the project.
Request data
HTTPS method: DELETE
For ease of viewing and identification:
- Required constants and parameters are shown in bold text.
- Optional parameters are shown in plain text.
URL format
https://baseURL/geofencing/versionNumber/projects/projectId?key=Your_API_Key&adminKey=Your_Admin_Key&dryRun=true/false
curl command
curl -XDELETE 'https://baseURL/geofencing/versionNumber/projects/projectId?key=Your_API_Key&adminKey=Your_Admin_Key&dryRun=true/false'
Request parameters
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 unique ID of a project to delete. Value: A UUID |
Optional parameters | |
Parameter | Description |
dryRun boolean |
Simulates project removal without actually deleting anything. The service sends the Response containing fences that would be cascade-removed. Default value: false Other value: true |
Response data
Response body
The following JSON code block demonstrates a successful Response from the API server.
{
"name": project_name",
"id": "project_id",
"dryRun" : true/false,
"deletedFences": [
{
"id": "dfence_1_id",
"name": "dfence_1_name"
}, ...
]
"removedRelationsToFences": [
{
"id": "rfence_1_id",
"name": "rfence_1_name"
}, ...
]
"removedRelationsToObjects": [
{
"id": "object_1_id",
"name": "object_1_name"
}, ...
]
}
Response fields
The following table describes all of the Response fields.
Primary fields | |
---|---|
Field | Description |
name string |
Name of the project. |
id string |
UUID of the project. |
dryRun boolean |
Indicates if the output is for a non-delete request (true), or the changes were actually made (false). |
deletedFences[] array |
(Optional) A list of UUIDs and names of fences that were deleted, because a deleted project is their only linked project. |
removedRelationsToFences[] array |
(Optional) A list of UUIDs and names of fences that remain in the system, but are unlinked from deleted project. |
removedRelationsToObjects[] array |
(Optional) A list of UUIDs and names of objects that lost their default project, because deleted project was their default project. |
deletedFences[] array |
|
Field | Description |
id string |
UUID of a fence. |
name string |
Name of a fence. |
removedRelationsToFences[] array |
|
Field | Description |
id string |
UUID of an object. |
name string |
Name of an object. |
HTTPS Response codes
Code | Meaning and possible causes |
---|---|
200 |
OK (for dry run mode) Deleted |
403 |
Forbidden:
|
404 |
Not Found: Project with the specified id does not exist. |
Examples
Request format
https://api.tomtom.com/geofencing/1/projects/44de824d-c368-46cf-a234-a6792682dfd6?key=Your_API_Key&adminKey=Your_Admin_Key&dryRun=true
Response body
{
"name": "Airports in Germany",
"id": "44de824d-c368-46cf-a234-a6792682dfd6",
"dryRun": true,
"deletedFences": [
{
"id": "5613e12e-6bc3-40c0-bc99-eaf0e4872e1e",
"name": "Fence2"
},
{
"id": "f0f159af-65bb-445c-a4db-40134f52fc35",
"name": "Fence1"
}
],
"removedRelationsToFences": [
{
"id": "aa134406-fa3a-488e-8817-a9865e46e5a0",
"name": "Fence3"
}
],
"removedRelationsToObjects": [
{
"id": "8d4b0d1b-1dd1-46eb-9c34-817759403746",
"name": "Object1"
},
{
"id": "5ffd4407-a15b-460f-bf8b-54028725d177",
"name": "Object2"
}
]
}