Skip to content

Garage

API path: /garage.

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. Garage id.
  • location - valid location or null.

list

Get all garages 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 garage.

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 garage.

errors

General types only.

update

Updates existing garage 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 garage with such an id).

delete

Deletes a garage with the specified id.

required sub-user rights: vehicle_update

parameters

name description type
garage_id Id of the garage 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 garage with such an id).

Last update: October 23, 2020