Ресурс

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

GETorPOST/api/team/get-list

Список

Этот метод возвращает постраничный список ваших объектов «Team». По умолчанию на странице до десяти записей.

Необязательные query-параметры

  • limit
    число
    Сколько объектов вернуть. По умолчанию 10, максимум 100
  • skip
    число
    Сколько объектов пропустить (для пагинации)

Необязательное тело запроса

Запрос списка

POST
/api/team/get-list?skip=0&limit=10
Заголовки
Content-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
    }
  ]
}
GETorPOST/api/team/:id/get-item

Получить по ID

Возвращает объект «Team» по идентификатору.

  • id
    строка
    ID объекта

Необязательное тело запроса

  • select
    По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.

Запрос одного объекта

POST
/api/team/:id/get-item
Заголовки
Content-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
}
POST/api/team/count

Количество

Возвращает количество ваших объектов «Team».

Необязательное тело запроса

Запрос количества

POST
/api/team/count
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "query": {
    "name": "Engineering Team"
  }
}

Ответ

{
  "count": 107
}
POST/api/team

Создать Team

Создаёт новый объект.

Запрос создания

POST
/api/team
Заголовки
Content-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
}
PUT/api/team/:id

Обновить по ID

Обновляет объект по ID.

Альтернативные методы

Если клиент не поддерживает PUT, используйте POST или GET с теми же заголовками и телом:

POST/api/team/:id/update-item
GET/api/team/:id/update-item

Запрос обновления

PUT
/api/team/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "name": "Engineering Team",
    "description": "Team responsible for backend services and infrastructure management"
  }
}

Ответ

{}
DELETE/api/team/:id

Удалить по ID

Удаляет объект по ID.

Альтернативные методы

Если клиент не поддерживает DELETE, используйте POST или GET с теми же заголовками и телом:

POST/api/team/:id/delete-item
GET/api/team/:id/delete-item

Запрос удаления

DELETE
/api/team/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY

Ответ

{}

Права доступа

Для операций с ресурсом у ключа API должны быть права. При их отсутствии вернётся ответ 4xx.

Права на чтение

Нужны для чтения Team

  • Project Owner
  • Project Admin
  • Project Member
  • Read Teams
  • Read All Project Resources

Права на создание

Нужны для создания Team

  • Project Owner
  • Project Admin
  • Project Member
  • Create Team

Права на обновление

Нужны для обновления Team

  • Project Owner
  • Project Admin
  • Invite New Members
  • Edit Team Permissions
  • Edit Team

Права на удаление

Нужны для удаления Team

  • Project Owner
  • Project Admin
  • Delete Team