Team
Teams lets your organize users of your project into groups and lets you assign different level of permissions.
Модель Team
Свойства
- Имя
_id- Тип
- Object ID
- Описание
ID of this object
- Имя
createdAt- Тип
- Date
- Описание
Date and Time when the object was created.
- Имя
updatedAt- Тип
- Date
- Описание
Date and Time when the object was updated.
- Имя
project- Тип
- Project
- Описание
Relation to Project Resource in which this object belongs
- Имя
projectId- Тип
- Object IDОбязательно
- Описание
ID of your Project in which this object belongs
- Имя
name- Тип
- TextОбязательно
- Описание
Any friendly name of this object
- Имя
description- Тип
- Long Text
- Описание
Friendly description that will help you remember
- Имя
slug- Тип
- SlugОбязательно
- Описание
Friendly globally unique name for your object
- Имя
createdByUser- Тип
- User
- Описание
Relation to User who created this object (if this object was created by a User)
- Имя
createdByUserId- Тип
- Object ID
- Описание
User ID who created this object (if this object was created by a User)
- Имя
isPermissionsEditable- Тип
- Boolean
- Описание
Can you edit team permissions? Teams auto-created for you are uneditable but you should be able to edit permissions on the team you create
- Имя
isTeamDeleteable- Тип
- Boolean
- Описание
Can you delete this team? Teams auto-created for you are not deleteable but you should be able to delete permissions on the team you create
- Имя
shouldHaveAtLeastOneMember- Тип
- Boolean
- Описание
Can this team have no members? Owner team should have at least 1 member, other teams can have no members
- Имя
isTeamEditable- Тип
- Boolean
- Описание
Can you edit team? Teams auto-created for you are uneditable but you should be able to edit on the team you create
/api/team/get-listСписок
Этот метод возвращает постраничный список ваших объектов «Team». По умолчанию на странице до десяти записей.
Необязательные query-параметры
limit- число
- Сколько объектов вернуть. По умолчанию 10, максимум 100
skip- число
- Сколько объектов пропустить (для пагинации)
Необязательное тело запроса
query- Чтобы фильтровать Team, укажите запрос здесь. Подробнее: написание запросов.
select- По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.
sort- По умолчанию сортировка по дате создания. Порядок можно изменить — см. раздел «Сортировка» в типах данных.
Запрос списка
POST/api/team/get-list?skip=0&limit=10Content-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"name": true,
"projectId": true,
"createdByUserId": true,
"description": true,
"isPermissionsEditable": true
},
"query": {
"name": "Engineering Team"
},
"sort": {
"createdAt": -1
}
}Ответ
{
"count": 10,
"limit": 10,
"skip": 0,
"data": [
{
"_id": "377e3be0-28fe-11f1-b591-3fdcef396aba",
"name": "Engineering Team",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "Team responsible for backend services and infrastructure management",
"isPermissionsEditable": true
},
{
"_id": "377e3be1-28fe-11f1-b591-3fdcef396aba",
"name": "Engineering Team",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "Team responsible for backend services and infrastructure management",
"isPermissionsEditable": true
},
{
"_id": "377e3be2-28fe-11f1-b591-3fdcef396aba",
"name": "Engineering Team",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "Team responsible for backend services and infrastructure management",
"isPermissionsEditable": true
}
]
}/api/team/:id/get-itemПолучить по ID
Возвращает объект «Team» по идентификатору.
id- строка
- ID объекта
Необязательное тело запроса
select- По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.
Запрос одного объекта
POST/api/team/:id/get-itemContent-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"name": true,
"projectId": true,
"createdByUserId": true,
"description": true,
"isPermissionsEditable": true
}
}Ответ
{
"_id": "377e3be0-28fe-11f1-b591-3fdcef396aba",
"name": "Engineering Team",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "Team responsible for backend services and infrastructure management",
"isPermissionsEditable": true
}/api/team/countКоличество
Возвращает количество ваших объектов «Team».
Необязательное тело запроса
query- Чтобы фильтровать Team, укажите запрос здесь. Подробнее: написание запросов.
Запрос количества
POST/api/team/countContent-Type: application/json ApiKey: YOUR_API_KEY
{
"query": {
"name": "Engineering Team"
}
}Ответ
{
"count": 107
}/api/teamСоздать Team
Создаёт новый объект.
Запрос создания
POST/api/teamContent-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"name": "Engineering Team",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "Team responsible for backend services and infrastructure management",
"createdByUser": "Example created by user"
}
}Ответ
{
"_id": "377e3be0-28fe-11f1-b591-3fdcef396aba",
"name": "Engineering Team",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "Team responsible for backend services and infrastructure management",
"isPermissionsEditable": true
}/api/team/:idОбновить по ID
Обновляет объект по ID.
Альтернативные методы
Если клиент не поддерживает PUT, используйте POST или GET с теми же заголовками и телом:
Запрос обновления
PUT/api/team/:idContent-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"name": "Engineering Team",
"description": "Team responsible for backend services and infrastructure management"
}
}Ответ
{}/api/team/:idУдалить по ID
Удаляет объект по ID.
Альтернативные методы
Если клиент не поддерживает DELETE, используйте POST или GET с теми же заголовками и телом:
Запрос удаления
DELETE/api/team/:idContent-Type: application/json ApiKey: YOUR_API_KEY
Ответ
{}Права доступа
Для операций с ресурсом у ключа API должны быть права. При их отсутствии вернётся ответ 4xx.
Права на чтение
Нужны для чтения Team
Project OwnerProject AdminProject MemberRead TeamsRead All Project Resources
Права на создание
Нужны для создания Team
Project OwnerProject AdminProject MemberCreate Team
Права на обновление
Нужны для обновления Team
Project OwnerProject AdminInvite New MembersEdit Team PermissionsEdit Team
Права на удаление
Нужны для удаления Team
Project OwnerProject AdminDelete Team