Vehicle - Zones

The Admin interface handles web service calls from the Admin web gui. The base url for this is at:

/api/vehicle-admin

A JSON file with OpenAPI data about all vehicle-related admin APIs can be downloaded here.

Get zone

Gets details of a zone:

GET /v1/zones/{id}

Return the info of the related Zone

Parameters
  • id (integer) – Zone ID

Status Codes
DELETE /v1/zones/{id}

Delete the indicated zone

Parameters
  • id (integer) – Zone ID

Status Codes
id: Zone ID (int)

Returns the details of the specified zone:

{
  "ID": 1,                                           // Int
  "CreatedDate": "2020-09-09T11:45:15Z",             // DateTime
  "LastUpdated": "2020-09-09T11:45:15Z",             // DateTime
  "Guid": "6d705861-31e0-4b5f-aef4-135517b5c715",    // Guid
  "Name": "London Heathrow Airport",                 // String
  "MainEntranceAddress": "Canberra Rd",              // String (nullable)
  "MainEntranceCity": "Longford, Hounslow, UK",      // String (nullable)
  "MainEntranceLatitude": 51.471158,                 // Double (nullable)
  "MainEntranceLongitude": -0.456838,                // Double (nullable)
  "CentroidLatitude": 51.471158,                     // Double (nullable)
  "CentroidLongitude": -0.45683800000000474,         // Double (nullable)
  "Geometry": "ChIJ9fkoIy68SUAR...",                 // ByteArray as String
  "MainEntranceOpeningHours": null,                  // String (nullable)
  "MainEntranceTermsConditions": null,               // String (nullable)
  "IsPaidParking": true,                             // Boolean
  "CanRefuelElectricVehicles": true,                 // Boolean
  "CanRefuelICEVehicles": false,                     // Boolean
  "IsFreefloatingArea": false,                       // Boolean
  "IsRoundtripArea": false,                          // Boolean
  "IsAvailable": true,                               // Boolean
  "ParkingSpots": 0,                                 // Int
  "Type": 0,                                         // Int
  "Polygon":
  {
    "Points":
    [
      {
          "Latitude": 51.470158000000005,            // Double
          "Longitude": -0.457838                     // Double
      },
      ...
    ]
  },
  "UtcOffsetMinutes": 60,                            // Int
  "CommunityCount": 0                                // Int
}

Value of the Type property can be one of the ZoneType enumeration.

Get zones

Gets a list of zones:

GET /v1/zones/list-all

Returns the list of all zones

Status Codes

Returns a list of all zones:

[
  {
    "ID": 1,                                           // Int
    "CreatedDate": "2020-09-09T11:45:15Z",             // DateTime
    "LastUpdated": "2020-09-09T11:45:15Z",             // DateTime
    "Guid": "6d705861-31e0-4b5f-aef4-135517b5c715",    // Guid
    "Name": "London Heathrow Airport",                 // String
    "MainEntranceAddress": "Canberra Rd",              // String (nullable)
    "MainEntranceCity": "Longford, Hounslow, UK",      // String (nullable)
    "MainEntranceLatitude": 51.471158,                 // Double (nullable)
    "MainEntranceLongitude": -0.456838,                // Double (nullable)
    "CentroidLatitude": 51.471158,                     // Double (nullable)
    "CentroidLongitude": -0.45683800000000474,         // Double (nullable)
    "Geometry": "ChIJ9fkoIy68SUAR...",                 // ByteArray as String
    "MainEntranceOpeningHours": null,                  // String (nullable)
    "MainEntranceTermsConditions": null,               // String (nullable)
    "IsPaidParking": true,                             // Boolean
    "CanRefuelElectricVehicles": true,                 // Boolean
    "CanRefuelICEVehicles": false,                     // Boolean
    "IsFreefloatingArea": false,                       // Boolean
    "IsRoundtripArea": false,                          // Boolean
    "IsAvailable": true,                               // Boolean
    "ParkingSpots": 0,                                 // Int
    "Type": 0,                                         // Int
    "Polygon":
    {
      "Points":
      [
        {
            "Latitude": 51.470158000000005,            // Double
            "Longitude": -0.457838                     // Double
        },
        ...
      ]
    },
    "UtcOffsetMinutes": 60,                            // Int
    "CommunityCount": 0                                // Int
  }
]

Value Type can be one of the ZoneType enumeration.

Get list of zones

Gets the list of existing zones (it’s a Paged List APIs, as explained in the introduction):

GET /v1/zones/list

Returns the list of all zones (within a page)

Status Codes

Returns a list of zones:

[
  {
    "ID": 1,                                           // Int
    "CreatedDate": "2020-09-09T11:45:15Z",             // DateTime
    "LastUpdated": "2020-09-09T11:45:15Z",             // DateTime
    "Guid": "6d705861-31e0-4b5f-aef4-135517b5c715",    // Guid
    "Name": "London Heathrow Airport",                 // String
    "MainEntranceAddress": "Canberra Rd",              // String (nullable)
    "MainEntranceCity": "Longford, Hounslow, UK",      // String (nullable)
    "MainEntranceLatitude": 51.471158,                 // Double (nullable)
    "MainEntranceLongitude": -0.456838,                // Double (nullable)
    "CentroidLatitude": 51.471158,                     // Double (nullable)
    "CentroidLongitude": -0.45683800000000474,         // Double (nullable)
    "Geometry": "ChIJ9fkoIy68SUAR...",                 // ByteArray as String
    "MainEntranceOpeningHours": null,                  // String (nullable)
    "MainEntranceTermsConditions": null,               // String (nullable)
    "IsPaidParking": true,                             // Boolean
    "CanRefuelElectricVehicles": true,                 // Boolean
    "CanRefuelICEVehicles": false,                     // Boolean
    "IsFreefloatingArea": false,                       // Boolean
    "IsRoundtripArea": false,                          // Boolean
    "IsAvailable": true,                               // Boolean
    "ParkingSpots": 0,                                 // Int
    "Type": 0,                                         // Int
    "Polygon":
    {
      "Points":
      [
        {
            "Latitude": 51.470158000000005,            // Double
            "Longitude": -0.457838                     // Double
        },
        ...
      ]
    },
    "UtcOffsetMinutes": 60,                            // Int
    "CommunityCount": 0                                // Int
  }
]

Value of the Type property can be one of the ZoneType enumeration.

Add new or edit existing zone

Persists edits about a new or existing zone:

POST /v1/zones

Persists edits about a new or existing zone

Status Codes

The body of the request is:

{
  ID: 123,                                                           // Int
  Name: "London Park",                                               // String
  MainEntranceAddress: "201 Street",                                 // String (nullable)
  MainEntranceCity: "London",                                        // String (nullable)
  MainEntranceOpeningHours: "8:30 - 19:00",                          // String (nullable)
  MainEntranceTermsConditions: "Terms and conditions",               // String (nullable)
  IsPaidParking: false,                                              // Boolean
  CanRefuelElectricVehicles: false,                                  // Boolean
  CanRefuelICEVehicles: false,                                       // Boolean
  IsFreefloatingArea: false,                                         // Boolean
  IsAvailable: false,                                                // Boolean
  MainEntranceLatitude: 46.00030058915435,                           // Double
  MainEntranceLongitude: 12.91133336705941,                          // Double
  Type: 0,                                                           // Int
  ParkingSpots: 0,                                                   // Int
  Polygon: "{\"Points\":[{\"Latitude\":51.51168272277966,\"Longitude\":-0.12754132197229986}, ...]}",  // String
  Communities: ["ac671321-3a6f-4e8e-810e-406a659987b1",  ...]        // Guid Array
}

If ID (zone ID) is not provided or is set to 0, then the request will create a new record.

The field Communities containes a list of community guids to the group to be linked to, and is mandatory while creating a new zone if the user has administrative rights limited to one or more community.

Value of the Type field must be one of the ZoneType enumeration.

Possible error messages are:

err_InvalidElement

No polygon or name has been provided, no community has been provided and the user is not a SuperAdmin or no zone to edit has been found for the provided ID

err_NotAdministrable

The user is trying to link the new zone to communities on which he has no administrative right.

Delete zone

Marks the specified zone as deleted:

GET /v1/zones/{id}

Return the info of the related Zone

Parameters
  • id (integer) – Zone ID

Status Codes
DELETE /v1/zones/{id}

Delete the indicated zone

Parameters
  • id (integer) – Zone ID

Status Codes
id: Zone ID (int)

If the request is successful, the corresponding zone record will be deleted and a plain Json positive response will be returned.

Possible error messages:

err_ElementDoesNotExist

There is no zone record corresponding to the ID in the request

err_ElementAlreadyDeleted

The specified zone record has already been deleted

Get zone vehicles

Gets a list of vehicles in a zone (it’s a Paged List APIs, as explained in the introduction):

GET /v1/zones/{id}/vehicle_in_zone

Returns the list of vehicles in the Zone

Parameters
  • id (integer) – Zone ID

Status Codes
id: Zone ID (int)

Returns a list of all the vehicles in the specified zone:

[
  {
  "ID": 26,                                                   // Int
  "LicensePlate": "AA000AA",                                  // String
  "VIN": "01234567890",                                       // String
  "Sticker": null,                                            // String (nullable)
  "LastSetOperativeBy": null,                                 // String (nullable)
  "IsOperative": true,                                        // Boolean
  "AdminOperativeStatus": true,                               // Boolean
  "SystemOperativeStatus": true,                              // Boolean
  "SystemOperativeReason": "",                                // String (nullable)
  "OverriddenSystemOperativeStatus": true,                    // Boolean
  "ForcedOperativeBy": "Administrator.name",                  // String (nullable)
  "Notes": null,                                              // String (nullable)
  "CategoryLabels": "{\"en\":\"Jolly Smart\"}",               // String
  "CategoryID": 2,                                            // Int
  "CategoryTree":
  {
    "ID": 1,                                                  // Int
    "Labels": "{\"en\":\"City Car\"}",                        // String
    "Children":                                               // Category Array (nullable)
    [ ... ]                                                   //
  },
  "Devices":                                                  // Device Array (nullable)
  [
    {
      "ID": 13,                                               // Int
      "SerialNumber": "EDOXVERZKOSYXUJ",                      // String
      "LastDeviceSync": "2001-01-01T00:00:00Z"                // DateTime (nullable)
    },
    ...
  ],
  "NominalGarage": "Udine Garage",                            // String
  "NominalGarageID": 4,                                       // Int
  "RecoveringGarage": null,                                   // String (nullable)
  "RecoveringGarageID": null,                                 // Int (nullable)
  "Latitude": 46.0838284476514,                               // Double (nullable)
  "Longitude": 13.217754364013674,                            // Double (nullable)
  "LastPositionUpdate": "2020-09-10T08:31:16Z",               // DateTime (nullable)
  "Groups": [ "51c770b3-c4f6-4203-9067-e05666137cec",... ],   // Guid Array
  "CurrentTripGuid": null,                                    // Guid (nullable)
  "DeviceID": 13,                                             // Int (nullable)
  "LastDeviceSync": null,                                     // DateTime (nullable)
  "LastNetworkSignalStrengthPct": null,                       // Int (nullable)
  "EngineType": 0,                                            // Int
  "FuelTankCapacity": null,                                   // Int (nullable)
  "FuelLevelPct": null,                                       // Double (nullable)
  "EVBLevelPct": null,                                        // Double (nullable)
  "OdometerKm": null,                                         // Double (nullable)
  "LastOdometerReading": null,                                // DateTime (nullable)
  "IsDamaged": true,                                          // Boolean (nullable)
  "Status":                                                   // Object (VehicleStatus)
  {                                                           //
    "CurrentReservationEnd": null,                            // DateTime (nullable)
    "CurrentReservationMaxStart": null,                       // DateTime (nullable)
    "CurrentReservationMinStart": null,                       // DateTime (nullable)
    "LastDeviceSync": null,                                   // DateTime (nullable)
    "LastMaintenanceEnd": null,                               // DateTime (nullable)
    "LastMaintenanceStart": null,                             // DateTime (nullable)
    "LastMotion": null,                                       // DateTime (nullable)
    "LastPositionUpdate": "2020-09-10T08:31:16Z",             // DateTime (nullable)
    "LastTripEnd": "2020-09-10T08:34:33Z",                    // DateTime (nullable)
    "LastTripStart": "2020-09-10T08:31:16Z",                  // DateTime (nullable)
    "FuelLevelPct": null,                                     // Double (nullable)
    "ServiceBattery": null,                                   // Double (nullable)
    "LastNetworkSignalStrengthPct": null,                     // Int (nullable)
    "AdminOperativeStatus": true,                             // Boolean
    "SystemOperativeStatus": true,                            // Boolean
    "IsLowFuel": true,                                        // Boolean
    "IsLowEVB": true,                                         // Boolean
    "IsLostContact": true,                                    // Boolean
    "IsPositionLost": true,                                   // Boolean
    "IsReserved": false,                                      // Boolean
    "IsOnTrip": false,                                        // Boolean
    "IsOnTripAndMoving": false,                               // Boolean
    "IsWithoutTripsForLong": true,                            // Boolean
    "IsInMaintenance": false,                                 // Boolean
    "IsInternetWeak": true                                    // Boolean
  },
  "InternalCleaningStatus": null,                             // Int (nullable)
  "ExternalCleaningStatus": null,                             // Int (nullable)
  "IgnitionVoltageLevel": null                                // Int (nullable)
  },
  ...
]

The field CategoryLabels and Labels in CategoryTree contain a stringified Json containing pairs “language code”:”localized value”

Value InternalCleaningStatus and ExternalCleaningStatus can be one of the VehicleCleaningStatus enumeration.

Values of EngineType can be one of the VehicleEngineTypes enumeration.