Conductores - Taller2Uber/application-server GitHub Wiki

Obtener Conductores

Obtener todos los conductores, si se le pasa como parametro query string "available" obtenemos solo los disponibles.

URL : /api/v1/drivers

Method : GET

Success Response

Condition : Si se pueden obtener los conductores.

Code : 200

Content example

[
    {
        "available": true,
        "first_name": "default",
        "last_name": "default",
        "gender": null,
        "country": "default",
        "firebase_token": "df7Bfmbs_KU:APA91bGIHoBUaFEVJ-HvGav__9D0rODHFwaC-aAfho6Tkbd5Ul83PzcOhc2yQ15-        Hmtq12D9bqPBrD-WnxAZ8hxahQaz3UTYIz4DdpBNfjm61z7rrDmA6UKMNNbN3EI2O_jSZO8lZQ1q",
        "fb_id": "",
        "longitude": null,
        "state": "no_route",
        "birthday": "1970-09-09T00:00:00.000Z",
        "actual_route": null,
        "cars": [],
        "latitude": null,
        "_ref": "67515c267b6d43a412d5dae8a789054c412d1f3c",
        "_id": {
            "$oid": "5a26b8a8e69acb000be4178e"
        },
        "user_name": "pedro",
        "email": "default",
        "ss_id": 275
    }
]

Obtener Conductor por Id

Obtener un conductor por su id.

URL : /api/v1/drivers/<driver_id>

Method : GET

Success Response

Condition : Si se puede obtener el conductor.

Code : 200

Content example

    {
        "available": true,
        "first_name": "default",
        "last_name": "default",
        "gender": null,
        "country": "default",
        "firebase_token": "df7Bfmbs_KU:APA91bGIHoBUaFEVJ-HvGav__9D0rODHFwaC-aAfho6Tkbd5Ul83PzcOhc2yQ15-        Hmtq12D9bqPBrD-WnxAZ8hxahQaz3UTYIz4DdpBNfjm61z7rrDmA6UKMNNbN3EI2O_jSZO8lZQ1q",
        "fb_id": "",
        "longitude": null,
        "state": "no_route",
        "birthday": "1970-09-09T00:00:00.000Z",
        "actual_route": null,
        "cars": [],
        "latitude": null,
        "_ref": "67515c267b6d43a412d5dae8a789054c412d1f3c",
        "_id": {
            "$oid": "5a26b8a8e69acb000be4178e"
        },
        "user_name": "pedro",
        "email": "default",
        "ss_id": 275
    }

Actualizar conductor

Actualizar conductor por id.

URL : /api/v1/drivers/<driver_id>

Method : PUT

Content example

    {
        "available": true,
        "first_name": "default",
        "last_name": "default",
        "gender": null,
        "country": "default",
        "firebase_token": "df7Bfmbs_KU:APA91bGIHoBUaFEVJ-HvGav__9D0rODHFwaC-aAfho6Tkbd5Ul83PzcOhc2yQ15-        Hmtq12D9bqPBrD-WnxAZ8hxahQaz3UTYIz4DdpBNfjm61z7rrDmA6UKMNNbN3EI2O_jSZO8lZQ1q",
        "fb_id": "",
        "longitude": null,
        "state": "no_route",
        "birthday": "1970-09-09T00:00:00.000Z",
        "actual_route": null,
        "cars": [],
        "latitude": null,
        "_ref": "67515c267b6d43a412d5dae8a789054c412d1f3c",
        "_id": {
            "$oid": "5a26b8a8e69acb000be4178e"
        },
        "user_name": "pedro",
        "email": "default"
    }

Success Response

Condition : Si se puede actualizar el conductor.

Code : 200

Content example

    {
        "available": true,
        "first_name": "default",
        "last_name": "default",
        "gender": null,
        "country": "default",
        "firebase_token": "df7Bfmbs_KU:APA91bGIHoBUaFEVJ-HvGav__9D0rODHFwaC-aAfho6Tkbd5Ul83PzcOhc2yQ15-        Hmtq12D9bqPBrD-WnxAZ8hxahQaz3UTYIz4DdpBNfjm61z7rrDmA6UKMNNbN3EI2O_jSZO8lZQ1q",
        "fb_id": "",
        "longitude": null,
        "state": "no_route",
        "birthday": "1970-09-09T00:00:00.000Z",
        "actual_route": null,
        "cars": [],
        "latitude": null,
        "_ref": "67515c267b6d43a412d5dae8a789054c412d1f3c",
        "_id": {
            "$oid": "5a26b8a8e69acb000be4178e"
        },
        "user_name": "pedro",
        "email": "default",
        "ss_id": 275
    }

Registrar auto a conductor

Registrar auto de conductor en la aplicacion.

URL : /api/v1/drivers/<driver_id/cars>

Method : POST

Content example

{
    "brand" : "Chevrolet",
    "model": "Corsa",
    "year": 2010,
    "license_plate" : "AAA 000",
    "ac": true
}

Espcificacion de campos

Nombre Tipo Requerido
brand string Si
model string Si
year integer Si
license_plate string Si
ac boolean Si

Success Response

Condition : Si se puede actualizar el conductor.

Code : 200

Content example

{
    "available": true,
    "first_name": "default",
    "last_name": "default",
    "gender": null,
    "cars": [
        {
            "model": "Corsa",
            "brand": "Chevrolet",
            "license_plate": "AAA 000",
            "ac": true,
            "year": 2010
        }
    ],
    "firebase_token": "df7Bfmbs_KU:APA91bGIHoBUaFEVJ-HvGav__9D0rODHFwaC-aAfho6Tkbd5Ul83PzcOhc2yQ15-Hmtq12D9bqPBrD-WnxAZ8hxahQaz3UTYIz4DdpBNfjm61z7rrDmA6UKMNNbN3EI2O_jSZO8lZQ1q",
    "fb_id": "",
    "longitude": null,
    "state": "no_route",
    "birthday": "1970-09-09T00:00:00.000Z",
    "actual_route": null,
    "country": "default",
    "latitude": null,
    "_ref": "67515c267b6d43a412d5dae8a789054c412d1f3c",
    "_id": {
        "$oid": "5a26b8a8e69acb000be4178e"
    },
    "user_name": "pedro",
    "email": "default",
    "ss_id": 275
}

Obtener autos de conductor

Listado de autos registrados de conductor

URL : /api/v1/drivers/<driver_id/cars>

Method : GET

Success Response

Condition : Si se puede actualizar el conductor.

Code : 200

Content example

[
    {
        "model": "Corsa",
        "year": 2010,
        "brand": "Chevrolet",
        "ac": true,
        "license_plate": "AAA 000"
    }
]
⚠️ **GitHub.com Fallback** ⚠️