This page contains the documentation for the REST API.
Creates a new user.
POST
/api/v5/user/create
| Parameter | type | Required | Description | Related Endpoint |
|---|---|---|---|---|
firstname |
string | yes | The first name of the user. | - |
lastname |
string | yes | The last name of the user. | - |
class_id |
integer | yes | The id of the class of the user. | /user/class |
usercard_id |
integer | no | The id of the usercard of the user. A user does not necessarily have to have a user card. The usercard can be added later using /user/change. |
/usercard |
token_id |
integer | no | The id of the token of the user. A user does not necessarily have to have a token. | /token |
ignore_duplicates |
boolean | no | If set to true, the user will be created even if a user with the same first and last name already exists. |
- |
| Code | Description |
|---|---|
SUCCESS |
The user was created successfully. |
USER_ALREADY_EXISTS |
A user with the same first and last name already exists. |
CLASS_NOT_FOUND |
The class with the given id does not exist. |
USERCARD_NOT_FOUND |
The usercard with the given id does not exist. |
TOKEN_NOT_FOUND |
The token with the given id does not exist. |
USERCARD_ALREADY_EXISTS |
The usercard with the given id is already assigned to another user. |
USERCARD_TYPE_NOT_FOUND |
The usercard type of the usercard with the given id does not exist. |
| Parameter | type | Description |
|---|---|---|
user_id |
string | The id of the created user. |
{
"firstname": "Max",
"lastname": "Mustermann",
"class_id": 1,
"usercard_id": 1,
"token_id": 1,
"ignore_duplicates": false
}Returns users. If no parameter is set, all users will be returned.
GET
/api/v5/user
| Parameter | type | Required | Description | Related Endpoint |
|---|---|---|---|---|
booking |
boolean | no | If set to true, only users that are currently booking will be returned. |
- |
query and strict |
string, boolean | no | Only users that contain the string in their first or last name or both combined will be returned. Cannot be used with booking parameter. The default value of strict is false. If strict is set to false the query will use Levenshtein distance method instead of simple string comparison. |
- |
page and size |
integer, integer | no | The page and the size of the page. It will only return a specific range of users. The default values are 0 and 0 where all users will be returned. The first page has an index of 0. | - |
| Code | Description |
|---|---|
SUCCESS |
The users were returned successfully. It also succeed when no users were found! |
| Parameter | type | Description |
|---|---|---|
data |
array | An array of users. If query parameter is set and strict is false, then there will be an accordance parameter at each user-data |
/api/v5/user?query=max%20mustermann