Sorry, you need to enable JavaScript to visit this website.

Delete fence

 

Service version: 1
Last edit: 2019.09.18

On this page

Purpose

This endpoint provides a command used to delete fences.

  • Information about all affected projects will be sent in the Response.
  • The delete command can also be used in dry run mode, which removes nothing but sends information about affected projects in the Response.

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.
https://baseURL/geofencing/versionNumber/fences/fenceId?key=Your_API_Key&adminKey=Your_Admin_Key&dryRun=true/false

curl command

curl -v -XDELETE -H 'https://baseURL/geofencing/versionNumber/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.
fenceId
string
The fence id to delete.
Value: A fence id.
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

▲ Return to top

Response data

Response body

{
  "name": "fence_name",
  "id": "fence_id",
  "dryRun" : true/false,
  "affectedProjects": [
    {
      "id" : project_1_id,
      "name" : project_1_name
    },
    ... ,
    {
      "id" : project_N_id,
      "name" : project_N_name
    }
  ]
}

Response fields

The following data tables describe all of the fields that can appear in a Response.

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).
affectedProjects[]
array
(Optional) The list of projects from which the fence was unlinked.
affectedProjects[] array
Field Description
id
string
The UUID of a project.
name
string
The name of a project.

HTTP Response codes

Code Meaning and possible causes
200 OK (for dry run mode) Deleted
403 Forbidden:

  • Provided Admin Key is invalid.
  • Admin Key is missing.
404 Not found: Fence with the specified id does not exist.

▲ Return to top

Examples

Request URL

https://api.tomtom.com/geofencing/1/projects/aaab6d78-1738-45bd-a78b-ff3a7ba839f3?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,
  "affectedProjects": [
    {
      "id": "65f88b21-63f8-4dc9-8e5a-330523c57f55",
      "name": "Project 1 Name"
    },
    {
      "id": "6608a5c5-d9e8-4589-acb8-1d5bba02b3f8",
      "name": "Project 2 Name"
    }
  ]
}

▲ Return to top

You are here