Skip to content

Latest commit

 

History

History
391 lines (278 loc) · 6.75 KB

File metadata and controls

391 lines (278 loc) · 6.75 KB

ILLA Supervisor Backend Invite APIs

Index

Consts

Invite Record Category

  • CATEGORY_INVITE_BY_LINK = 1
  • CATEGORY_INVITE_BY_EMAIL = 2

Invite Record Status

  • INVITE_RECORD_STATUS_OK = 1
  • INVITE_RECORD_STATUS_USED = 2
  • INVITE_RECORD_STATUS_SUSPEND = 3

User Role

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

Redirect Page

  • SHARE_LINK_REDIRECT_PAGE_EDIT = "edit"
  • SHARE_LINK_REDIRECT_PAGE_RELEASE = "release"

Get Invite Link

Desc

For generate invite link.

API Endpoint

GET  /api/v1/teams/:teamID/inviteLink/userRole/:userRole

Request Body

none

Response

{
    "inviteLink": "https://cloud-api.illacloud.com/api/v1/join/xxxxxxxxxxxxxxxxxxxxxxxxxx",
    "teamID": 12,
    "userRole": 2
}

Renew Invite Link

Desc

Re-generate the invitation link Note that only the team owner and admin have this privilege, other users will get an illegal request.

API Endpoint

GET  /api/v1/teams/:teamID/newInviteLink/userRole/:userRole

Request Body

none

Response

{
    "inviteLink": "https://cloud-api.illacloud.com/api/v1/join/xxxxxxxxxxxxxxxxxxxxxxxxxx",
    "teamID": 12,
    "userRole": 2
}

Disable Invite Link

Desc

For disable the invite link.

API Endpoint

PUT  /api/v1/teams/:teamID/disableAllInviteLink

Request Body

none

Response

// HTTP 200
// or
// HTTP 400

Enable Invite Link

Desc

For enable the invite link.

API Endpoint

PUT  /api/v1/teams/:teamID/enableAllInviteLink

Request Body

none

Response

// HTTP 200
// or
// HTTP 400

Invite by Email

Desc

Send invitation links based on emails.

API Endpoint

POST  /api/v1/teams/:teamID/inviteByEmail

Request Body

{
    "email": "user1@email.com",
    "userRole": 2

Success Response

{
    "email": "user1@email.com",
    "teamID": 12,
    "userRole": 2,
    "emailStatus": true
}

Join Team by Invite Link (Already logged in)

Desc

Join the team by following the invitation link. This interface is only available if you are already logged in.

API Endpoint

PUT  /api/v1/join/:inviteLinkHash

Request Body

none

Response

// HTTP 200

Change invite by email user role

Desc

Modify roles for users based on email invitations.

Tips

  • After the invitation email has been sent, a user has been created in the team_membrs table of the database, and the user's role can be changed using the "Change Team Members Role" [# Change TeamMembers Role](. /team_members/README.md) API.

Get Share App Link

Desc

Get the Share APP link, which has an appID more than the Invite to join link to facilitate the jump.

API Endpoint

GET  /api/v1/teams/:teamID/shareAppLink/userRole/:userRole/apps/:appID/redirectPage/:redirectPage

Request Body

none

Response

{
    "teamID": "ILAfx4p1C7cR",
    "appID": "ILAfx4p1C7ec",
    "userRole": 3,
    "inviteLink": "https://cloud.illacloud.com/?inviteToken=ZjU2NzBiNjUtOGZjZC00Y2UzLTliYmMtNmIyYmRlNjA2Y2Vi&appID=ILAfx4p1C7ec&redirectPage=edit"
}

Renew Share App Link

Desc

Re-generate the invitation link. Note that only the team owner and admin have this privilege, other users will get an illegal request.

API Endpoint

GET  /api/v1/teams/:teamID/newShareAppLink/userRole/:userRole/apps/:appID/redirectPage/:redirectPage

Request Body

none

Response

{
    "teamID": "ILAfx4p1C7cR",
    "appID": "ILAfx4p1C7ec",
    "userRole": 3,
    "inviteLink": "https://cloud.illacloud.com/?inviteToken=ZjNmYjBiMzQtYjBiMi00ZTM5LThkZTgtODFlYzZhNjViOTA5&appID=ILAfx4p1C7ec&redirectPage=release"
}

Share App by Email

Desc

Share App by Email.

API Endpoint

POST  /api/v1/teams/:teamID/shareAppByEmail

Request Body

{
    "email": "user1@email.com",
    "userRole": 2,
    "appID": 81312,
    "redirectPage": "release",
}

Success Response

{
    "email": "user1@email.com",
    "teamID": 12,
    "userRole": 2,
    "appID": 81312,
    "redirectPage": "release",
    "emailStatus": true
}

Tips

The link in the email has an email and appID, so it's easy to sign up and jump afterward.

https://cloud.illacloud.com/?inviteToken=YWU0MmFjMjctODc2NC00OWEyLWExZjUtNDRhNzBkN2I0OWM1&email=youremail@outlook.com&appID=xxxxxxxx