Drivers
Reference for the API endpoints related to the drivers.
Create a driver
POST https://journal-de-bord-api.app/api/drivers
Create a new driver. You need to create a new driver to create a new journal.
Headers
Content-Type
string
application/json
Authorization
string
Bearer {Access token (J.W.T.)}
Request Body
identifier
string
This is a unique string. This should be the user identifier provided by the authorization server.
objective
number
This is the number of kilometres the drivers wants to reach at the end of his training.
Empty body.{
"timestamp": "2021-03-27T08:31:39.150+00:00",
"status": 400,
"error": "Bad Request",
"message": "",
"path": "/api/drivers"
}{
"timestamp": "2021-03-27T08:31:02.417+00:00",
"status": 409,
"error": "Conflict",
"message": "",
"path": "/api/drivers"
}{
"timestamp": "2021-03-27T08:32:04.883+00:00",
"status": 422,
"error": "Unprocessable Entity",
"message": "",
"path": "/api/drivers"
}Get a driver
GET https://journal-de-bord-api.app/api/drivers/{identifier}
This method is used to get the basic information of a driver.
Path Parameters
identifier
string
This is the identifier of the driver. The value should be set to the J.W.T. subject (sub) field.
Headers
Authorization
string
Bearer {Access token (J.W.T.)}
{
"identifier": <driver's identifier>,
"objective": <number of kilometers>
}{
"timestamp": "2021-03-27T08:47:41.332+00:00",
"status": 403,
"error": "Forbidden",
"message": "",
"path": "/api/drivers/differentDriverIdentifier"
}{
"timestamp": "2021-03-27T08:47:41.332+00:00",
"status": 403,
"error": "Forbidden",
"message": "",
"path": "/api/drivers/unknownDriverIdentifier"
}Last updated
Was this helpful?