Skip to content

Latest commit

 

History

History
251 lines (190 loc) · 4.79 KB

File metadata and controls

251 lines (190 loc) · 4.79 KB

ILLA Supervisor Backend TeamMembers APIs

Index

Consts

User Role In Team

  • USER_ROLE_OWNER = 1
  • USER_ROLE_ADMIN = 2
  • USER_ROLE_EDITOR = 3
  • USER_ROLE_VIEWER = 4

User Status In Team

  • STATUS_OK = 1
  • STATUS_PENDING = 2

Get All TeamMembers By TeamID

Desc

Gets information about all members of the user team. The return structure couples the user table and the team_members table's user-related displayable fields. This includes the user's role in the team (userRole) and invited status (userStatus).

API Endpoint

GET  /api/v1/teams/:teamID/members

Request Body

none

Response

[
    {
        "userID": "1",
        "nickname": "your_nickname",
        "email": "[email protected]",
        "avatar": "https://cdn.illacloud.com/team/1/user/12/avatar.png",
        "userRole": 1,   // The role of the user in the team
        "userStatus": 1, // The status of the user in the team
        "permission": { // Reserved field for the user's permission in this team.
            "reserved": ""
        },
        "createdAt": "ISO-8601 timestamp",
        "updatedAt": "ISO-8601 timestamp",
    },
    {
        "userID": "2",
        "nickname": "your_nickname",
        "email": "[email protected]",
        "avatar": "https://cdn.illacloud.com/team/1/user/12/avatar.png",
        "userRole": 2, 
        "userStatus": 2, 
        "permission": { 
            "reserved": ""
        },
        "createdAt": "ISO-8601 timestamp",
        "updatedAt": "ISO-8601 timestamp",
    },
    ...
]

Get Team User By TeamID userID

Desc

The user gets information about the user's permissions in the team. The return structure couples the user-related displayable fields of the user and team_members tables.

API Endpoint

GET  /api/v1/teams/:teamID/users/:targetUserID

Request Body

none

Response

[
    {
        "userID": "1",
        "uid": "uuidxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "nickname": "your_nickname",
        "email": "[email protected]",
        "avatar": "https://cdn.illacloud.com/team/1/user/12/avatar.png",
        "language": "en-US",
        "isSubscribed": false,
        "userRole": 1,   
        "userStatus": 1, 
        "permission": { 
            "reserved": ""
        },
        "createdAt": "ISO-8601 timestamp",
        "updatedAt": "ISO-8601 timestamp",
    }
]

Change TeamMembers Role

Note that if the current user is the owner, setting another user as the owner will cause you to lose your owner privileges. The client should prompt you accordingly. That is, this interface can be used as a transfer owner. Of course, this interface has attribute detection, so you can't override the role.

API Endpoint

PATCH  /api/v1/teams/:teamID/users/:targetUserID/role

Request Body

{
    "userRole": 2
}

Response

none

Config Invite Link

Configure whether team can invite users using links

API Endpoint

PATCH  /api/v1/teams/:teamID/configInviteLink

Request Body

{
    "inviteLinkEnabled": true
}

Response

// HTTP 200
// or 
// HTTP 400

Change TeamMembers Permission

API Endpoint

PATCH  /api/v1/teams/:teamID/users/:userID/permission

Request Body

{
    "permission": {
        "reserved"
    }
}

Response

// HTTP 200
// or 
// HTTP 400

Remove TeamMembers

Desd

Remove Team Members Can also be used to leave the team yourself

API Endpoint

DELETE  /api/v1/teams/:teamID/users/:userID

Request Body

none

Response

none