Vehicle - Garages

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 Garage

Gets details about a specific garage:

GET /v1/garages/{id}

Gets details about a specific garage

Parameters
  • id (integer) – The id of the garage

Status Codes
DELETE /v1/garages/{id}

Marks a garage as deleted

Parameters
  • id (integer) – The id of the garage to delete

Status Codes
id: Garage ID (int)

Returns a Json positive response and the details of the specified Garage area:

{
  "Name": "Udine Garage",                     // String
  "CreatedDate": "2020-09-09T12:49:45Z",      // DateTime
  "Address": "Piazza Primo Maggio",           // String (nullable)
  "City": "Udine",                            // String (nullable)
  "Notes": null,                              // String (nullable)
  "Contacts": null,                           // String (nullable)
  "ReceptionLatitude": 46.0647821674842,      // Double (nullable)
  "ReceptionLongitude": 13.23556423187256,    // Double (nullable)
  "ID": 4                                     // Int
}

Get Garage list

Gets the list of garages:

GET /v1/garages/list

Gets the list of garages

Status Codes

Returns the list of all garages:

[
  {
    "Name": "London Maintenance Garage",                          // String
    "CreatedDate": "2020-09-09T11:45:16Z",                        // DateTime
    "Address": "Perimeter Rd N",                                  // String (nullable)
    "City": "Horley, UK",                                         // String (nullable)
    "Notes": null,                                                // String (nullable)
    "Contacts": null,                                             // String (nullable)
    "ReceptionLatitude": 51.160741,                               // Double (nullable)
    "ReceptionLongitude": -0.190689,                              // Double (nullable)
    "ID": 1                                                       // Int
  },
  ...
]

Get Garages in area

Gets the list of garages inside a rectangle:

POST /v1/garages/area

Gets the list of garages inside a rectangle

Status Codes

The body of the request is:

{
  NorthBound: 51.15819239128527,              // Double (nullable)
  EastBound: -0.19279595396931362,            // Double (nullable)
  SouthBound: 51.15819239128527,              // Double (nullable)
  WestBound: -0.19279595396931362             // Double (nullable)
}

The request requires all points to be provided, otherwise a plain Json error response will be returned.

A list of all the valid garages within the specified rectangle will be returned:

[
  {
    "Name": "London Maintenance Garage",      // String
    "CreatedDate": "2020-09-09T11:45:16Z",    // DateTime
    "Address": "Perimeter Rd N",              // String (nullable)
    "City": "Horley, UK",                     // String (nullable)
    "Notes": null,                            // String (nullable)
    "Contacts": null,                         // String (nullable)
    "ReceptionLatitude": 51.160741,           // Double (nullable)
    "ReceptionLongitude": -0.190689,          // Double (nullable)
    "ID": 1                                   // Int
  },
      ...
]

Add new or edit existing garage

Persists edits about a new or existing garage:

POST /v1/garages

Persists edits about a new or existing garage

Status Codes

The request body is:

{
  ID: 123,                                    // Int
  Name: "Garage Name",                        // String
  Address: "102 Street Name",                 // String (nullable)
  City: "London",                             // String (nullable)
  Notes: "Additional notes",                  // String (nullable)
  Contacts: "John Doe",                       // String (nullable)
  ReceptionLatitude: 51.15819239128527,       // Double (nullable)
  ReceptionLongitude: -0.19279595396931362    // Double (nullable)
}

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

Returns a plain Json positive response if the record was successfully added or edit, or a Json negative response with no additional data is there was a problem while saving or updating the data.

Possible errors are:

err_InvalidElement

No garage was found for the provided ID or no Name was provided in the request object

Delete Garage

Marks a garage as deleted:

GET /v1/garages/{id}

Gets details about a specific garage

Parameters
  • id (integer) – The id of the garage

Status Codes
DELETE /v1/garages/{id}

Marks a garage as deleted

Parameters
  • id (integer) – The id of the garage to delete

Status Codes
id: Garage ID (int)

The record corresponding to the ID will be marked as deleted and a plain Json positive response will be returned if the request is successful.

Possible error messages are:

err_ElementDoesNotExist

No garage corresponds to the ID provided in the request

err_ElementAlreadyDeleted

The specified garage has already been marked as deleted

err_CannotDelete

The specified garage has vehicles currently recovered in it

Get nominal vehicles

Gets the list of vehicle nominally assigned to a specific garage (it’s a Paged List APIs, as explained in the introduction):

GET /v1/garages/{id}/nominal-vehicles

Gets the list of vehicle nominally assigned to a specific garage

Parameters
  • id (integer) – The id of the garage

Status Codes
id: Garage ID (int)

Returns a list of vehicles that are nominally assigned to the specified garage area:

[
  {
    "ID": 26,                                                     // Int
    "LicensePlate": "AA000AA",                                    // String
    "VIN": "01234567890",                                         // String
    "Sticker": "10",                                              // String
    "LastSetOperativeBy": "Administrator",                        // 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
    "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)
    "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": {
      "CurrentReservationEnd": "2020-09-10T09:20:00Z",            // DateTime (nullable)
      "CurrentReservationMaxStart": "2020-09-10T08:50:00Z",       // DateTime (nullable)
      "CurrentReservationMinStart": "2020-09-10T08:28:41Z",       // 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)
      "EVBLevelPct": 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": false,                                    // Boolean
      "IsReserved": true,                                         // Boolean
      "IsOnTrip": false,                                          // Boolean
      "IsOnTripAndMoving": false,                                 // Boolean
      "IsWithoutTripsForLong": false,                             // Boolean
      "IsInMaintenance": false,                                   // Boolean
      "IsInternetWeak": true                                      // Boolean
    },
    "InternalCleaningStatus": null,                               // Int (nullable)
    "ExternalCleaningStatus": null,                               // Int (nullable)
    "IgnitionVoltageLevel": null                                  // Int (nullable)
  },
  ...
]

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

Values of EngineType can be one of the VehicleEngineTypes enumeration.

GetRecoveredVehicles

Gets the list of vehicles currently recovered at a specific garage (it’s a Paged List APIs, as explained in the introduction):

GET /v1/garages/{id}/recovered-vehicles

Gets the list of vehicles recovered at a specific garage

Parameters
  • id (integer) – The id of the garage

Status Codes
id: Garage ID (int)

Returns a list of vehicles that are currently assigned to the specified garage area:

[
  {
    "ID": 26,                                                     // Int
    "LicensePlate": "AA000AA",                                    // String
    "VIN": "01234567890",                                         // String
    "Sticker": "10",                                              // String
    "LastSetOperativeBy": "Administrator",                        // 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
    "Devices":                                                    // Object Array (nullable)
    [
      {
        "ID": 13,                                                 // Int
        "SerialNumber": "EDOXVERZKOSYXUJ",                         // String
        "LastDeviceSync": "2001-01-01T00:00:00Z"                  // DateTime (nullable)
      }
    ],
    "NominalGarage": "Udine Garage",                              // String
    "NominalGarageID": 4,                                         // Int
    "RecoveringGarage": "Udine Garage",                           // String
    "RecoveringGarageID": 4,                                      // Int
    "Latitude": 46.0838284476514,                                 // Double (nullable)
    "Longitude": 13.217754364013674,                              // Double (nullable)
    "LastPositionUpdate": "2020-09-10T08:31:16Z",                 // DateTime (nullable)
    "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": {
      "CurrentReservationEnd": "2020-09-10T09:20:00Z",            // DateTime (nullable)
      "CurrentReservationMaxStart": "2020-09-10T08:50:00Z",       // DateTime (nullable)
      "CurrentReservationMinStart": "2020-09-10T08:28:41Z",       // 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)
      "EVBLevelPct": 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": false,                                    // Boolean
      "IsReserved": true,                                         // Boolean
      "IsOnTrip": false,                                          // Boolean
      "IsOnTripAndMoving": false,                                 // Boolean
      "IsWithoutTripsForLong": false,                             // Boolean
      "IsInMaintenance": false,                                   // Boolean
      "IsInternetWeak": true                                      // Boolean
    },
    "InternalCleaningStatus": null,                               // Int (nullable)
    "ExternalCleaningStatus": null,                               // Int (nullable)
    "IgnitionVoltageLevel": null                                  // Int (nullable)
  },
  ...
]

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

Values of EngineType can be one of the VehicleEngineTypes enumeration.