Skip to main content

Group car api (0.4.0)

Download OpenAPI specification:Download

Authentication

Requests for authentication

Get the csrf token

Authorizations:
csrfToken

Responses

Log in

Logs the user in with the given username and the given password

Authorizations:
csrfToken
Request Body schema: application/json

Login data

username
string
password
string

Responses

Request samples

Content type
application/json
{
  • "username": "demo",
  • "password": "123456"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "statusCode": 0,
  • "timestamp": "2019-08-24T14:15:22Z",
  • "message": "string",
  • "detail": {
    }
}

Sign up

Signs the user up with the given attributes

Authorizations:
csrfToken
Request Body schema: application/json

The sign up properties

email
string
username
string
password
string

Responses

Request samples

Content type
application/json
{
  • "email": "demo@mai.com",
  • "username": "demo",
  • "password": "123456"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "statusCode": 0,
  • "timestamp": "2019-08-24T14:15:22Z",
  • "message": "string",
  • "detail": {
    }
}

Log the client out

Log the client out by replacing the jwt cookie with a pre-login one

Authorizations:
csrfToken

Responses

Response samples

Content type
application/json
{
  • "status": "Unauthorized",
  • "statusCode": 401,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "You're not authorized to view the requested resourced.",
  • "detail": {
    }
}

Check if logged in

Check if the current state of the client indicates that it is logged in. Checks the jwt token and the payload within.

Authorizations:
csrfToken

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "username": "string",
  • "email": "string",
  • "isBetaUser": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Change password of currently logged in user

Change the password of the currently logged in user. There are some conditions that have to be true, before a call to this endpoint will succeed.

  1. The new password has to be different than the old password
  2. The new password has to fulfill the typical password constraints
  3. The old password has to be correct
Authorizations:
csrfToken
Request Body schema: application/json

The old and new password.

oldPassword
string
newPassword
string

Responses

Request samples

Content type
application/json
{
  • "oldPassword": "string",
  • "newPassword": "string"
}

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "Your new password has to be different than your old password.",
  • "detail": {
    }
}

User

Requests for everything user related

Change password of currently logged in user

Change the password of the currently logged in user. There are some conditions that have to be true, before a call to this endpoint will succeed.

  1. The new password has to be different than the old password
  2. The new password has to fulfill the typical password constraints
  3. The old password has to be correct
Authorizations:
csrfToken
Request Body schema: application/json

The old and new password.

oldPassword
string
newPassword
string

Responses

Request samples

Content type
application/json
{
  • "oldPassword": "string",
  • "newPassword": "string"
}

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "Your new password has to be different than your old password.",
  • "detail": {
    }
}

Create new pseudo-random profile picture

Generates a new pseudo-random profile picture with the given username as seed. An offset can be send with the username to generate a different profile picture for the same username. The same username and offset will always produce the same profile picture.

Authorizations:
csrfToken
query Parameters
username
required
string
offset
number

Responses

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Searches for users

Searches for a limited list of users which start with the specified query. The maximum amount of the list is 20 users

Authorizations:
csrfToken
query Parameters
filter
required
string

Filters with what the username of the returned users should start with

limit
number

Limits the amount of users which are returned. Maximum is 20.

Responses

Response samples

Content type
application/json
{
  • "users": [
    ]
}

Get the profile picture

Get the profile picture of the user with the given id

Authorizations:
csrfToken
path Parameters
userId
required
integer

The id of the user

Responses

Response samples

Content type
application/json
{
  • "status": "Not found",
  • "statusCode": 404,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "A user with id 4 doesn't exist",
  • "detail": {
    }
}

Get all invites

Get a list of all invites of the currently logged in user

Authorizations:
csrfToken

Responses

Response samples

Content type
application/json
{
  • "invites": [
    ]
}

Joins the group

Joins the group with the given id by accepting an invite for it

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Responses

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Group

Requests for everything groups related

Gets groups

Returns the list of groups the currently logged in user is a member of

Authorizations:
csrfToken

Responses

Response samples

Content type
application/json
{
  • "groups": [
    ]
}

Creates a new group

Create a new group with the currently logged in user as admin and owner.

Authorizations:
csrfToken
Request Body schema: application/json

The initial group data.

name
required
string
description
string

Responses

Request samples

Content type
application/json
{
  • "name": "Family group",
  • "description": "Our new group for the family"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "ownerId": 0,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Get group data

Get the data of a group if the user is a member of that group

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Responses

Response samples

Content type
application/json
Example
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "ownerId": 0,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "Owner": {
    }
}

Updates a group

Updated the group with the given data. The user can only update a group if the user is an admin of that group.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Request Body schema: application/json

The data with which the group should be updated

name
string
description
string

Responses

Request samples

Content type
application/json
{
  • "name": "Family group",
  • "description": "Our new group for the family"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "ownerId": 0,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Deletes a group

Delete the group which has the given id if the user which requests the action is the owner of that group

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Responses

Response samples

Content type
application/json
{
  • "status": "Unauthorized",
  • "statusCode": 401,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "You're not authorized to view the requested resourced.",
  • "detail": {
    }
}

Get all invited users of this group

Gets a list of all users which are invited to the specified group.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Responses

Response samples

Content type
application/json
{
  • "invites": [
    ]
}

Invites a user to the group

Invites a user to the group

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Request Body schema: application/json

Either the id or the username of the user. If both are provided the username will be ignored.

One of
userId
integer

Responses

Request samples

Content type
application/json
{
  • "username": "test-user"
}

Response samples

Content type
application/json
{
  • "userId": 0,
  • "groupId": 0,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "invitedBy": 0
}

Leaves the specified group

Removes the currently logged in user from the specified group.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Responses

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Get members

Get the list of members of the specified group

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Responses

Response samples

Content type
application/json
{
  • "members": [
    ]
}

Kicks a user

Kicks the specified user from the specified group. The owner can kick any user, an admin can kick any non-admin user and normal members cannot kick any user.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

userId
required
integer

The id of the user

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Grants a user admin permissions

Grants the specified user admin permissions.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

userId
required
integer

The id of the user

Responses

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Grants a user admin permissions

Grants the specified user admin permissions.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

userId
required
integer

The id of the user

Responses

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Transfers ownership to specified user

Transfers the ownership of the currently logged in user of the specified group to the specified user

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

userId
required
integer

The id of the user

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "ownerId": 0,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "Owner": {
    }
}

Get all cars

Get a list of all cars for the specified group

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Responses

Response samples

Content type
application/json
{
  • "cars": [
    ]
}

Create a car

Creates a new car for the specified group. Only an admin can do this.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Request Body schema: application/json

Car data

name
string
color
string (CarColor)
Enum: "Red" "Green" "Blue" "Black" "Yellow" "White" "Purple" "Brown" "Orange"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "color": "Red"
}

Response samples

Content type
application/json
{
  • "groupId": 0,
  • "carId": 0,
  • "name": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "color": "Red",
  • "driverId": 0
}

Delete a car

If the logged-in user is an admin of the group with the given id, they can delete the given car.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

carId
required
integer

The id of the car

Responses

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Drive a car

Request to drive the specified car. A user can only drive a car if they are not currently driving another car and the car is available.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

carId
required
integer

The id of the car

Responses

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Park the car

Park the specified car at the specified location. Only the driver of a car can park a car. After this action the car will have no driver.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

carId
required
integer

The id of the car

Request Body schema: application/json

The request body has to include the latitude and longitude of the location.

latitude
required
number
longitude
required
number

Responses

Request samples

Content type
application/json
{
  • "latitude": 0,
  • "longitude": 0
}

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Member

Requests for everything members related

Get members

Get the list of members of the specified group

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Responses

Response samples

Content type
application/json
{
  • "members": [
    ]
}

Kicks a user

Kicks the specified user from the specified group. The owner can kick any user, an admin can kick any non-admin user and normal members cannot kick any user.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

userId
required
integer

The id of the user

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Grants a user admin permissions

Grants the specified user admin permissions.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

userId
required
integer

The id of the user

Responses

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Grants a user admin permissions

Grants the specified user admin permissions.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

userId
required
integer

The id of the user

Responses

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Transfers ownership to specified user

Transfers the ownership of the currently logged in user of the specified group to the specified user

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

userId
required
integer

The id of the user

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "ownerId": 0,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "Owner": {
    }
}

Car

Requests for everything car related

Get all cars

Get a list of all cars for the specified group

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Responses

Response samples

Content type
application/json
{
  • "cars": [
    ]
}

Create a car

Creates a new car for the specified group. Only an admin can do this.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

Request Body schema: application/json

Car data

name
string
color
string (CarColor)
Enum: "Red" "Green" "Blue" "Black" "Yellow" "White" "Purple" "Brown" "Orange"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "color": "Red"
}

Response samples

Content type
application/json
{
  • "groupId": 0,
  • "carId": 0,
  • "name": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "color": "Red",
  • "driverId": 0
}

Delete a car

If the logged-in user is an admin of the group with the given id, they can delete the given car.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

carId
required
integer

The id of the car

Responses

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Drive a car

Request to drive the specified car. A user can only drive a car if they are not currently driving another car and the car is available.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

carId
required
integer

The id of the car

Responses

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Park the car

Park the specified car at the specified location. Only the driver of a car can park a car. After this action the car will have no driver.

Authorizations:
csrfToken
path Parameters
groupId
required
integer

The id of the group

carId
required
integer

The id of the car

Request Body schema: application/json

The request body has to include the latitude and longitude of the location.

latitude
required
number
longitude
required
number

Responses

Request samples

Content type
application/json
{
  • "latitude": 0,
  • "longitude": 0
}

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "The sent request is missing required attributes.",
  • "detail": {
    }
}

Settings

Requests related to user settings

Change password of currently logged in user

Change the password of the currently logged in user. There are some conditions that have to be true, before a call to this endpoint will succeed.

  1. The new password has to be different than the old password
  2. The new password has to fulfill the typical password constraints
  3. The old password has to be correct
Authorizations:
csrfToken
Request Body schema: application/json

The old and new password.

oldPassword
string
newPassword
string

Responses

Request samples

Content type
application/json
{
  • "oldPassword": "string",
  • "newPassword": "string"
}

Response samples

Content type
application/json
{
  • "status": "Bad Request",
  • "statusCode": 400,
  • "timestamp": "2020-05-03T13:21:35.938Z",
  • "message": "Your new password has to be different than your old password.",
  • "detail": {
    }
}

Test path

A test path to check if the server is reachable

Authorizations:
csrfToken

Responses

Response samples

Content type
application/json
{
  • "server": "up",
  • "database": "up"
}

Get the backend version

Returns the semver version of the backend

Authorizations:
csrfToken

Responses

Response samples

Content type
application/json
{
  • "version": "string"
}