Skip to content

Garage

Contains garage object and API calls to interact with it. Depot (garage object) contains name, address, name of the mechanic, name of the dispatcher and others. This data can be used for more convenient and efficient maintenance and task management.


Garage object

{
    "id": 222,
    "location": {
        "lat": 40.4,
        "lng": -3.6,
        "address": "Calle Salitre, 58",
        "radius": 150
    },
    "mechanic_name": "Martinez",
    "dispatcher_name": "Velasquez",
    "organization_name": "Bankia"
}
  • id - int. Depot id.
  • location - location object. Valid location or null.

API actions

API path: /garage.

list

Gets all depots belonging to user.

examples

curl -X POST 'https://api.navixy.com/v2/garage/list' \
    -H 'Content-Type: application/json' \ 
    -d '{"hash": "a6aa75587e5c59c32d347da438505fc3"}'
https://api.navixy.com/v2/garage/list?hash=a6aa75587e5c59c32d347da438505fc3

response

{
    "success": true,
    "list": [{
        "id": 222,
        "location": {
         "lat": 40.4,
         "lng": -3.6,
         "address": "Calle Salitre, 58",
         "radius": 150
        },
        "mechanic_name": "Martinez",
        "dispatcher_name": "Velasquez",
        "organization_name": "Bankia"
    }]
}

errors

General types only.


create

Creates a new depot.

required sub-user rights: vehicle_update.

parameters

name description type
garage An garage object without id field. JSON object

example

curl -X POST 'https://api.navixy.com/v2/garage/create' \
    -H 'Content-Type: application/json' \ 
    -d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "garage": {"location": {"lat": 40.4, "lng": -3.6, "address": "Calle Salitre, 58", "radius": 150}, "mechanic_name": "Martinez", "dispatcher_name": "Velasquez", "organization_name": "Bankia"}}'

response

{
    "success": true,
    "id": 111
}
  • id - int. An id of a created depot.

errors

General types only.


update

Updates existing depot with the specified id.

required sub-user rights: vehicle_update.

parameters

name description type
garage An garage object with id field. JSON object

example

curl -X POST 'https://api.navixy.com/v2/garage/update' \
    -H 'Content-Type: application/json' \ 
    -d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "garage": {"id": 222, location": {"lat": 40.4, "lng": -3.6, "address": "Calle Salitre, 58", "radius": 150}, "mechanic_name": "Martinez", "dispatcher_name": "Velasquez", "organization_name": "Bankia"}}'

response

{ "success": true }

errors

  • 201 – Not found in the database - if there is no depot with such an id.

delete

Deletes a depot with the specified id.

required sub-user rights: vehicle_update.

parameters

name description type
garage_id Id of the depot to delete. int

examples

curl -X POST 'https://api.navixy.com/v2/garage/delete' \
    -H 'Content-Type: application/json' \ 
    -d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "garage_id": 111}'
https://api.navixy.com/v2/garage/delete?hash=a6aa75587e5c59c32d347da438505fc3&garage_id=111

response

{ "success": true }

errors

  • 201 – Not found in the database - if there is no depot with such an id.

Last update: July 22, 2021