-
Notifications
You must be signed in to change notification settings - Fork 3
Users
- Верифікувати статус студента
- Верифікувати статус супергероя
- Додати супергероя
- Надати користувачу роль
- Забрати у користувача роль
- Видалити юзера
- Поновити юзера
- Отримати усі контакти юзера
- Створити контакт
- Поновити контакт
- Видалити контакт
- Видалити студента
- Поновити студента
- Отримати юзера для телеграму
- Приєднання телеграму до зареєстрованого акаунту
- Отримати юезра для нього ж самого
Authorization
Bearer <Bot Token>
Request options
{
params: {
userId: string,
},
body: {
state: 'APPROVED' | 'PENDING' | 'DECLINED',
isCaptain: boolean,
},
}
Response body
{
firstName: string,
middleName: string,
lastName: string,
user: {
id: string,
username: string,
email: string,
telegramId: number,
avatar: string,
state: 'APPROVED' | 'PENDING' | 'DECLINED',
},
group: string,
roles: {
role: 'CAPTAIN' | 'MODERATOR' | 'STUDENT',
},
state: 'APPROVED' | 'PENDING' | 'DECLINED',
}
Expected exceptions
400 InvalidEntityIdException: 'user with such id is not found'
400 InvalidBodyException: 'State is not an enum'
400 InvalidBodyException: 'isCaptain must be a boolean'
Authorization
Bearer <Bot Token>
Request options
{
params: {
userId: string,
},
body: {
state: 'APPROVED' | 'PENDING' | 'DECLINED',
},
}
Response body
{
userId: string,
dorm: boolean
}
Expected exceptions
400 InvalidEntityIdException: 'user with such id is not found'
400 InvalidBodyException: 'State is not an enum'
Authorization
Bearer <JWT AccessToken>
Request options
{
params: {
userId: string,
},
body: {
dorm: boolean,
},
}
Response body
Expected exceptions
403 NoPermissionException 'You do not have permission to perform this action'
400 InvalidEntityIdException: 'user with such id is not found'
400 InvalidBodyException: 'Dorm is not a number'
Authorization
Request options
{
params: {
userId: string,
},
body: {
roleId: string,
},
}
Response body
Expected exceptions
400 InvalidEntityIdException: 'user with such id is not found'
400 InvalidBodyException: 'Role id can not be empty'
Authorization
Request options
{
params: {
userId: string,
roleId: string,
},
}
Response body
Expected exceptions
400 InvalidEntityIdException: 'user with such id is not found'
Authorization
Bearer <JWT AccessToken>
Request options
{
params: {
userId: string,
},
}
Response body
Expected exceptions
403 NoPermissionException 'You do not have permission to perform this action'
400 InvalidEntityIdException: 'user with such id is not found'
Authorization
Bearer <JWT AccessToken>
Request options
{
params: {
userId: string,
},
body: {
username?: string;
state?: State;
avatar?: string;
email?: string;
},
}
Response body
Expected exceptions
403 NoPermissionException 'You do not have permission to perform this action'
400 InvalidEntityIdException: 'user with such id is not found'
400 InvalidBodyException: 'Username is too short (min: 2)'
400 InvalidBodyException: 'Username is too long (max: 40)'
400 InvalidBodyException: 'Username is not correct (a-zA-Z0-9_)'
400 InvalidBodyException: 'State is not an enum'
400 InvalidBodyException: 'Avatar link is too long (max: 400)'
400 InvalidBodyException: 'Email is not an email'
Authorization
Bearer <JWT AccessToken>
Request options
{
params: {
userId: string,
},
}
Response body
{
contacts: {
id: string,
link: string,
name: string,
displayName: string
}[],
}
Expected exceptions
403 NoPermissionException 'You do not have permission to perform this action'
400 InvalidEntityIdException: 'user with such id is not found'
Authorization
Bearer <JWT AccessToken>
Request options
{
params: {
userId: string,
},
body: {
name: string,
value: string,
},
}
Response body
{
id: string,
name: string,
value: string,
}
Expected exceptions
403 NoPermissionException 'You do not have permission to perform this action'
400 InvalidEntityIdException: 'user with such id is not found'
400 InvalidBodyException: 'Name is too long (max: 100)'
400 InvalidBodyException: 'Name can not be empty'
400 InvalidBodyException: 'Name is not correct (a-zA-Z0-9A-Я(укр.)\\-\' )'
400 InvalidBodyException: 'Display name is too long (max: 100)'
400 InvalidBodyException: 'Display name can not be empty'
400 InvalidBodyException: 'Display name contains wrong symbols (ASCII only)'
400 InvalidBodyException: 'Link is too long (max: 200)'
400 InvalidBodyException: 'Link can not be empty'
400 InvalidBodyException: 'Link contains wrong symbols (ASCII only)'
Authorization
Bearer <JWT AccessToken>
Request options
{
params: {
userId: string,
name: string,
},
body: {
name?: string;
value?: string;
},
}
Response body
{
id: string,
link: string,
name: string,
displayName: string,
}
Expected exceptions
403 NoPermissionException 'You do not have permission to perform this action'
400 InvalidEntityIdException: 'user with such id is not found'
400 InvalidContactNameException: 'Contact with such name is not found'
400 InvalidBodyException: 'Display name is too long (max: 100)'
400 InvalidBodyException: 'Display name contains wrong symbols (ASCII only)'
400 InvalidBodyException: 'Link is too long (max: 200)'
400 InvalidBodyException: 'Link contains wrong symbols (ASCII only)'
Authorization
Bearer <JWT AccessToken>
Request options
{
params: {
userId: string,
name: string,
},
}
Response body
Expected exceptions
403 NoPermissionException 'You do not have permission to perform this action'
400 InvalidEntityIdException: 'user with such id is not found'
400 InvalidContactNameException: 'Contact with such name is not found'
Authorization
Bearer <JWT AccessToken>
Request options
{
params: {
userId: string,
},
}
Response body
Expected exceptions
403 NoPermissionException 'You do not have permission to perform this action'
400 InvalidEntityIdException: 'user with such id is not found'
Authorization
Bearer <JWT AccessToken>
Request options
{
params: {
userId: string,
},
body: {
firstName?: string,
lastName?: string,
middleName?: string,
groupId?: string,
state?: 'APPROVED' | 'PENDING' | 'DECLINED',
},
}
Response body
{
firstName: string,
middleName: string,
lastName: string,
user: {
id: string,
username: string,
email: string,
telegramId: number,
avatar: string,
state: 'APPROVED' | 'PENDING' | 'DECLINED',
},
group: string,
roles: {
role: 'CAPTAIN' | 'MODERATOR' | 'STUDENT',
},
state: 'APPROVED' | 'PENDING' | 'DECLINED',
}
Expected exceptions
403 NoPermissionException 'You do not have permission to perform this action'
400 InvalidEntityIdException: 'user with such id is not found'
400 InvalidBodyException: 'First name is not correct (A-Я(укр.)\\-\' )'
400 InvalidBodyException: 'First name is too short (min 2)'
400 InvalidBodyException: 'First name is too long (max 40)'
400 InvalidBodyException: 'Last name is not correct (A-Я(укр.)\\-\' )'
400 InvalidBodyException: 'Last name is too short (min 2)'
400 InvalidBodyException: 'Last name is too long (max 40)'
400 InvalidBodyException: 'Middle name is not correct (A-Я(укр.)\\-\' )'
400 InvalidBodyException: 'Middle name is too short (min 2)'
400 InvalidBodyException: 'Middle name is too long (max 40)'
400 InvalidBodyException: 'State is not an enum'
Authorization
Bearer <Bot Token>
Request options
{
params: {
userId: string,
},
}
Response body
{
id: string,
telegramId: number,
username: string,
email: string,
firstName: string,
lastName: string,
middleName: string,
avatar: string,
group: {
id: string,
code: string
},
}
Expected exceptions
400 InvalidEntityIdException: 'user with such id is not found'
Authorization
Bearer <JWT AccessToken>
Request options
{
params: {
userId: string,
},
body: {
auth_date: number,
first_name: string,
hash: string,
id: number,
last_name: string,
photo_url: string,
username: string,
},
}
Response body
Expected exceptions
403 NoPermissionException 'You do not have permission to perform this action'
400 InvalidEntityIdException: 'user with such id is not found'
400 InvalidBodyException: 'first_name can not be empty'
400 InvalidBodyException: 'hash can not be empty'
400 InvalidBodyException: 'photo_url can not be empty'
400 InvalidBodyException: 'username can not be empty'
Authorization
Bearer <JWT AccessToken>
Request options
{
params: {
userId: string,
},
}
Response body
{
id: string,
telegramId: number,
username: string,
email: string,
firstName: string,
lastName: string,
middleName: string,
avatar: string,
group: {
id: string,
code: string
},
}
Expected exceptions
403 NoPermissionException 'You do not have permission to perform this action'
400 InvalidEntityIdException: 'user with such id is not found'