×

Delete geofence

This API deletes a geofence from the system. When a geofence is deleted, all links between this geofence and vehicles are automatically removed.

How to get data

Method

GET

Request address

To get the data, use the address: https://<server_address>/api/api.php?

Request parameters

  • cmd=geofencedel — command to delete a geofence
  • id — internal geofence ID (required if external_id is not specified)
  • external_id — external geofence identifier (optional, if specified, id is ignored)
  • node — node number where the command should be executed
 

Example request

https://<server_address>/api/api.php?cmd=geofencedel&id=158412&node=1
Response
{
  "code": 0,
  "message": "OK",
  "data": {
    "zones_removed": [
      158412
    ],
    "vehicles_unlinked": {
      "158412": [
        112917,
        112401,
        111219,
        109794,
        109793,
        109792,
        109791,
        109787,
        105190,
        66500,
        66499,
        66497,
        41432,
        39850,
        2744
      ]
    }
  }
}
In response to the API request, the following is returned:
  • code — result code (0 = success)
  • message — server message indicating the result of the operation
  • zones_removed — array of IDs of deleted geofences
  • vehicles_unlinked — object where the key is the geofence ID and the value is an array of vehicle IDs from which the geofence was unlinked