Request
- Endpoint -
/account/registration
- Method -
POST
- Headers -
browser: {browserName} {browserVersion}
Request:
{
"login": str, # [a-z0-9_]{4,32}
"password": str, # ((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20})
"email": str, # ^(.+)@(.+)\.(.+)$
"first_name": str, # [А-Я]{1}[а-я ]{1,255}
"last_name": str, # [А-Я]{1}[а-я ]{1,255}
"patronymic": Optional[str], # [А-Я]{1}[а-я ]{1,255}
}
Response: Code 200
{
"id": int,
"login": str,
"email": str,
"first_name": str,
"last_name": str,
"created_at": str, # 2024-03-07 23:32:53.818302
"description": str,
"background_color": str, # #005CC9
"birthday": str, # "2005-04-07" | ""
"patronymic": str, # | ""
"avatar": str, # Url for static
"groups": [],
"roles": [],
"permissions": [], # Permissions name
"token": str
}
Errors:
Code 400
- User form input error
Code 403
- Request data is incorrect
Code 500
- Server error
{
"errorMessage": str
}
Request
- Endpoint-
/account/login
- Method -
POST
- Headers -
browser: browserName browserVersion
Request
{
"password": str,
# Must email or login
"login": Optional[str],
"email": Optional[str]
}
Response
{
"id": int,
"login": str,
"email": str,
"first_name": str,
"last_name": str,
"created_at": str, # 2024-03-07 23:32:53.818302
"description": str,
"background_color": str, # #005CC9
"birthday": str, # "2005-04-07" | ""
"patronymic": str, # | ""
"avatar": str, # Url for static
"groups": [
{
"id": int,
"name": str
}
],
"roles": [
{
"id": int,
"name": str
}
],
"permissions": [str], # Permissions name
"token": str
}
Errors:
Code 400
- User form input error
Code 403
- Request data is incorrect
Code 500
- Server error
{
"errorMessage": str
}
- Endpoint -
/account/login/check
- Method -
GET
Request params:
login=str
Response
{
'message': str,
'is_login_available': bool
}
- Endpoint -
/account/me
- Method -
GET
- Headers -
Authorization: token
Response
{
"id": int,
"login": str,
"email": str,
"first_name": str,
"last_name": str,
"created_at": str, # 2024-03-07 23:32:53.818302
"description": str,
"background_color": str, # #005CC9
"birthday": str, # "2005-04-07" | ""
"patronymic": str, # | ""
"avatar": str, # Url for static
"groups": [
{
"id": int,
"name": str
}
],
"roles": [
{
"id": int,
"name": str
}
],
"permissions": [str], # Permissions name
"token": str
}
- Endpoint -
/account/edit/info
- Method -
POST
- Headers -
Authorization: token
Request
{
"first_name":str,
"last_name":str,
"patronymic": str,
"birthday": str,
"description": str,
"background_color": str
}
Example
{
"background_color": "#e209e5",
"first_name": "Данила",
"last_name": "Гинда",
"patronymic": "",
"birthday": "2005-04-07",
"description": "Backend Developer from Voskresensk"
}
Response
{
"first_name":str,
"last_name":str,
"patronymic": str,
"birthday": str,
"description": str,
"background_color": str
}
- Endpoint -
/info/users/
- Method -
GET
Response
[
{
"id": int,
"login": str,
"email": str,
"first_name": str,
"last_name": str,
"created_at": str, # 2024-03-07 23:32:53.818302
"description": str,
"background_color": str, # #005CC9
"birthday": str, # "2005-04-07" | ""
"patronymic": str, # | ""
"avatar": str, # Url for static
"groups": [],
"roles": []
}
]
- Endpoint -
/info/users/search-<login|id>
- Method -
GET
Response
{
"id": int,
"login": str,
"email": str,
"first_name": str,
"last_name": str,
"created_at": str, # 2024-03-07 23:32:53.818302
"description": str,
"background_color": str, # #005CC9
"birthday": str, # "2005-04-07" | ""
"patronymic": str, # | ""
"avatar": str, # Url for static
"groups": [],
"roles": []
}