Driver Style API (0.2.0)

Download OpenAPI specification:Download

The purpose of this application is to provide vehicles with a score based on their driving, values based upon quartix data.

Authentication

JWT

For accessing the API a valid JWT token must be passed in all the queries in the 'Authorization Basic' header.

To generate a JWT, pass in the user_id: user_id, and the api_key: public key in the JWT payload, using the private key to sign the token, using the HS256 algorithm. If doing manually add a : to the JWT string before base64 encoding the token. Most HTTP client libraries (guzzle, unirest etc) handle this automatically.

The following syntax must be used in the 'Authorization' header :

Basic: xxxxxx.yyyyyyy.zzzzzz

Security scheme type: API Key
header parameter name: Authorization

Journeys

Handler returning aggregated list of vehicle driver style scores

List of vehicle driver style scores using vehicles in the same customer as the user id who made the request

Authorizations:
query Parameters
from
string
Example: 1514764800

The from journey date

to
string
Example: 1514764900

The to journey date

Responses

200

List of journeyBehaviour scores

400

Generic Error

get /journeys
https://unknown/api/v1/journeys

Response samples

application/json
Copy
Expand all Collapse all
{
  • "status": 200,
  • "status_desc": "OK",
  • "request_id": "bapr-jqs0-3ao3-2e96-1vqg",
  • "latency": "10.21412ms",
  • "aggregated_scores":
    {
    }
}

Vehicles

Handler returning list of vehicle style scores

List of vehicle driver style scores using the supplied vehicle id and the time span

Authorizations:
path Parameters
id
required
integer
Example: 1000
query Parameters
from
string
Example: 1514764800

The from journey date

to
string
Example: 1514764900

The to journey date

Responses

200

List of vehicleJourneyBehaviour scores

400

Generic Error

get /vehicles/{id}
https://unknown/api/v1/vehicles/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "status": 200,
  • "status_desc": "OK",
  • "request_id": "bapr-jqs0-3ao3-2e96-1vqg",
  • "latency": "10.21412ms",
  • "journeys":
    {
    },
  • "vehicle":
    {
    }
}

Drivers

Handler returning a single driver

Get a driver and their driver score

Authorizations:
path Parameters
id
required
integer
Example: 1000

Responses

200

Get a single driver

400

Generic Error

get /drivers/{id}
https://unknown/api/v1/drivers/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "status": 200,
  • "status_desc": "OK",
  • "request_id": "bapr-jqs0-3ao3-2e96-1vqg",
  • "latency": "10.21412ms",
  • "driver":
    {
    }
}

Units

Updates the unit vehicle to assign a driver id

Assign driver id to journey

Authorizations:
path Parameters
id
required
integer
Example: 1000

The unit id

journey
required
string
Example: 1514764800

The journey date

Request Body schema: application/json
driver_id
integer

The ID of the driver to assign

Responses

200

Success response

400

Generic Error

put /units/{id}/journeys/{journey}
https://unknown/api/v1/units/{id}/journeys/{journey}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "driver_id": 8
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "latency": "10.2121ms",
  • "request_id": "bapr-jqs0-3ao3-2e96-1vqg",
  • "status": 200,
  • "status_desc": "OK"
}