📁
Journal de bord
  • Introduction
  • Single Page Application
    • Overview
    • Installation
    • Features
    • Design
    • Development
    • Backend integration
  • Backend
    • Overview
    • Installation
    • Configuration
    • Development
    • Data Model
    • API reference
      • Rides
      • Drivers
    • Database management
  • Security
    • Overview
    • OAuth 2.0
    • Authorization Server (Keycloak)
    • Client-side flow
    • OpenID Connect
Powered by GitBook
On this page
  • Create a driver
  • Get a driver

Was this helpful?

  1. Backend
  2. API reference

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

Name
Type
Description

Content-Type

string

application/json

Authorization

string

Bearer {Access token (J.W.T.)}

Request Body

Name
Type
Description

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

Name
Type
Description

identifier

string

This is the identifier of the driver. The value should be set to the J.W.T. subject (sub) field.

Headers

Name
Type
Description

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"
}
PreviousRidesNextDatabase management

Last updated 4 years ago

Was this helpful?