User Interfaces

1. AUTH

1.1 Registration

Registering a system

Before logging in, a graphical verification code is required to pass through the verifyCode parameter.

Resource URI: /login
Method: POST

Name

Definition

Type

Required

Describe

verifyCode

Graphics Validation Code

query

Yes.

username

User name/mailbox/cell phone number

body

Yes.

password

Password.

body

Yes.

Example response:

response 200 OK

1.2 Access to current login user information

and obtaining the information of the current login user through the interface after the user login is successful.

Resource URI: auth/login-info
Method: GET

Example response:

response 200 OK
{
  "username": "TestUser1",
  "mailAddress": "test@edgegallery.org",
  "telephone": "13812345678",
  "createTime":"2021-02-24 04:39:23",
  "allowed": true,
  "userId": "37423702-051a-46b4-bf2b-f190759cc0b8",
  "permissions": [
    {
      "platform": "APPSTORE",
      "role": "GUEST"
    }
  ]
}

1.3 Log out

Logout system

Resource URI: /auth/logout
Method: GET

Example response:

200 OK
Succeed

2 USER-MGMT

2.1 Registered users

registering the user interface, registering successfully returning 200 and returning the user information that has been registered successfully; the interface data is not fully returned to 400.

Before registration, a graphical verification code is required to pass through the verifyCode parameter.

Resource URI: /v1/users
Method: POST

Name

Definition

Type

Required

Describe

verifyCode

Graphics Validation Code

query

Yes.

username

User name

body

Yes.

Must be a combination of letters or letters and numbers, must start with a letter, between 6 and 30 characters in length

password

Password.

body

Yes.

Complexity requirements must be met, must be a combination of number/letter/t number characters, length between 6 and 18 characters

mailAddress

Mailbox Address

body

not

If completed, the format requirements of the mailbox address must be met

telephone

Mobile phone number

body

not

If filled, must be 11 valid digits and start with 1

Example request:

{
  "username": "TestUser1",
  "mailAddress": "test@edgegallery.org",
  "telephone": "13812345678",
  "password": "123.qwe"
}

Example response:

response 201 OK
{
  "username": "TestUser1",
  "mailAddress": "test@edgegallery.org",
  "telephone": "13812345678",
  "userId": "37423702-051a-46b4-bf2b-f190759cc0b8",
  "permissions": [
    {
      "platform": "APPSTORE",
      "role": "GUEST"
    }
  ]
}

response 400 Bad Request
{
  "code": 0,
  "message": "string"
}

response 403 FORBIDDEN
{
  "code": 0,
  "message": "string"
}

response 500 INTERNAL ERROR
{
  "code": 0,
  "message": "string"
}

2.2 Modify password (personal modification password & recover password)

  1. Personal password modification includes three scenarios:

the personal password is modified by the original password verification mode in the personal centre after the user is logged in.

(2) After the admin logs in for the first time, it is mandatory to change the personal default password

(3) The password of a non-guest user expires after more than 90 days, and it is mandatory to change the password after logging in

  1. If the user registers a real email address or cell phone number (which can also be filled in the personal center), the password can be reset by way of mailbox or mobile phone verification code.An open mail service or short message service is required to use.

Resource URI: /v1/users/password
Method: PUT

Name

Definition

Type

Required

Describe

type

Modify the type of password

body

Yes.

1 – Password verification modification; 2 – password recovery

newPassword

New password after modification

body

Yes.

Complexity requirements must be met, must be a combination of number/letter/t number characters, length between 6 and 18 characters

oldPassword

original password

body

not

Required when type= 1

telephone

Mobile phone number

body

not

When type= 2, and need to be recovered through the cell phone number, fill out the registered cell phone number.Validity with mailAddress is mutually exclusive

mailAddress

Mailbox Address

body

not

When type= 2, and need to be recovered via the mailbox, fill out the address of the mailbox that has been registered.mutex with telphone validity

verificationCode

Verification code

body

not

6 valid numbers.Required when type= 2

Example request:

{
  "type": 2,
  "newPassword": "123.qwe",
  "oldPassword": "",
  "telephone": "",
  "mailAddress": "test@edgegallery.org",
  "verificationCode": "123456"
}

Example response:

response 200 OK

response 400 Bad Request
{
  "code": 0,
  "message": "string"
}

response 403 FORBIDDEN
{
  "code": 0,
  "message": "string"
}

response 500 INTERNAL ERROR
{
  "code": 0,
  "message": "string"
}

2.3 Check repeat user

judging whether the user name or the mobile phone number has been registered, and is not allowed to re-register.

Resource URI: /v1/users/action/uniqueness
Method: POST

Name

Definition

Type

Required

Describe

username

User name

body

Yes.

Must be a combination of letters or letters and numbers, must start with a letter, between 6 and 30 characters in length

mailAddress

Mailbox Address

body

not

If completed, the format requirements of the mailbox address must be met

telephone

Mobile phone number

body

not

If filled, must be 11 valid digits and start with 1

Example request:

{
  "username": "TestUser1",
  "mailAddress": "test@edgegallery.org",
  "telephone": "13812345678"
}

Example response:

response 200 OK
{
    "username": true or false,
    "mailAddress": true or false,
    "telephone": true or false
}

2.4 List of query users

List of user administrators

Resource URI: /v1/users/list
Method: POST
Role: APPSTORE_ADMIN or DEVELOPER_ADMIN or MECM_ADMIN or LAB_ADMIN or ATP_ADMIN
User: admin

Name

Definition

Type

Required

Describe

username

User name

body

not

User name keyword for fuzzy query conditions

mailAddress

Mailbox Address

body

not

Mailbox address keyword for fuzzy query conditions

telephone

Phone number

body

not

Phone number keyword for fuzzy query conditions

role

characters

body

Yes.

ALL – All; ADMIN – Manager; TENANT – Tenant; GUEST – Visitors

status

state

body

Yes.

-1 – All; 0 – Disabled; 1 – Enable

createTimeBegin

Creation Time (i.e. Enrollment Time) Range – Initiation

body

not

From Time, Format: 2021-1-21

createTimeEnd

Creation Time (i.e. Enrollment Time) Range – Termination

body

not

Termination Time, Format: 2021-2-1

offset

Query starting position

body

Yes.

Paging control parameters, indicating the initial location of the query

limit

Query Records

body

Yes.

Paging control parameters that indicate the number of query records per page

sortBy

Sort field

body

not

Word name for sorting.USERNAME – Sort by username; CREATETIME – Sort by create (registration) time

sortOrder

Sort Order

body

not

Sort sequence.ASC – Ascending; DESC – Descending

Example request:

{
  "username": "",
  "mailAddress": "",
  "telephone": "",
  "role": "",
  "status": -1,
  "createTimeBegin": "2021-1-21",
  "createTimeEnd": "2021-2-1",
  "queryCtrl": {
    "offset": 0,
    "limit": 10,
    "sortBy": "USERNAME",
    "sortOrder": "DESC"
  }
}

Example response:

response 200 OK
{
  "totalCount": 20,
  "userList": [
    {
      "username": "TestUser1",
      "mailAddress": "test@edgegallery.org",
      "telephone": "13812345678",
      "userId": "37423702-051a-46b4-bf2b-f190759cc0b8",
      "permissions": [
        {
          "platform": "APPSTORE",
          "role": "GUEST"
        }
      ],
      "allowed": true,
      "createTime": "2021-1-21 10:24:45"
    }
  ]
}

response 400 Bad Request
{
  "code": 0,
  "message": "string"
}

response 403 FORBIDDEN
{
  "code": 0,
  "message": "string"
}

response 500 INTERNAL SERVER ERROR
{
  "code": 0,
  "message": "string"
}

2.5 Delete user

The user administrator can delete any user based on the user ID

Resource URI: /v1/users/{userId}
Method: DELETE
Role: APPSTORE_ADMIN or DEVELOPER_ADMIN or MECM_ADMIN or LAB_ADMIN or ATP_ADMIN
User: admin

Name

Definition

Type

Required

Describe

userId

User ID

path

Yes.

uuid

Example request:


Example response:

response 200 OK

response 400 Bad Request
{
  "code": 0,
  "message": "string"
}

response 403 FORBIDDEN
{
  "code": 0,
  "message": "string"
}

2.6 Modifies user personal information

The user can modify the personal information and return the modified information.

Resource URI: /v1/users/{userId}
Method: PUT

Name

Definition

Type

Required

Describe

userId

User ID

path

Yes.

uuid

username

User name

body

Yes.

Must be a combination of letters or letters and numbers, must start with a letter, between 6 and 30 characters in length

mailAddress

Mailbox Address

body

not

If completed, the format requirements of the mailbox address must be met

telephone

Mobile phone number

body

not

If filled, must be 11 valid digits and start with 1

Example request:

{
  "username": "TestUser1",
  "mailAddress": "test@edgegallery.org",
  "telephone": "13812345678"
}

Example response:

response 200 OK
{
  "username": "TestUser1",
  "mailAddress": "test@edgegallery.org",
  "telephone": "13812345678",
  "userId": "37423702-051a-46b4-bf2b-f190759cc0b8",
  "permissions": [
    {
      "platform": "APPSTORE",
      "role": "GUEST"
    }
  ]
}

response 400 Bad Request
{
  "code": 0,
  "message": "string"
}

response 403 FORBIDDEN
{
  "code": 0,
  "message": "string"
}

2.7 Disable user

The user administrator can disable the user according to the user ID, wherein the user ID is the user ID of the non-built-in user.The user will not be able to register after disabling.

Resource URI: /v1/users/status/{userId}/disallow
Method: PUT
Role: APPSTORE_ADMIN or DEVELOPER_ADMIN or MECM_ADMIN or LAB_ADMIN or ATP_ADMIN
User: admin

Name

Definition

type

Required

Describe

userId

User ID

path

Yes.

uuid

Example request:


Example response:

response 200 OK

response 400 Bad Request
{
  "code": 0,
  "message": "string"
}

response 403 FORBIDDEN
{
  "code": 0,
  "message": "string"
}

2.8 Enable users

The user administrator can enable the user according to the user ID, wherein the user ID is the user ID of the non-built-in user.

Resource URI: /v1/users/status/{userId}/disallow
Method: PUT
Role: APPSTORE_ADMIN or DEVELOPER_ADMIN or MECM_ADMIN or LAB_ADMIN or ATP_ADMIN
User: admin

Name

Definition

Type

Required

Describe

userId

User ID

path

Yes.

uuid

Example request:


Example response:

response 200 OK

response 400 Bad Request
{
  "code": 0,
  "message": "string"
}

response 403 FORBIDDEN
{
  "code": 0,
  "message": "string"
}

2.9 User roles are set

The user administrator can set the role and the accessible platform thereof according to the user ID.

Resource URI: /v1/users/settings/{userId}
Method: PUT
Role: APPSTORE_ADMIN or DEVELOPER_ADMIN or MECM_ADMIN or LAB_ADMIN or ATP_ADMIN
User: admin

Name

Definition

Type

Required

Describe

userId

User ID

path

Yes.

uuid

platform

Access platform

body

Yes.

User accessible platform

role

characters

body

Yes.

The role of the user

Example request:

{
  "permissions": [
    {
      "platform": "APPSTORE",
      "role": "GUEST"
    }
  ]
}

Example response:

response 200 OK

response 400 Bad Request
{
  "code": 0,
  "message": "string"
}

response 403 FORBIDDEN
{
  "code": 0,
  "message": "string"
}

3 IDENTITY

3.1 Access to short message verification code

sending the verification code to the appointed mobile phone number, sending the successful return 200, sending the failure to return 417.

It is necessary to obtain the graphic verification code before sending the short message verification code, which is passed through the verifyCode parameter.

Resource URI: /v1/identity/sms
Method: POST

Name

Definition

Type

Required

Describe

verifyCode

Graphics Validation Code

query

Yes.

telephone

Phone number

body

Yes.

11 valid digits, must start with 1

Example request:

{
  "telephone": "15191881159"
}

Example response:

response 200 OK

response 417 Expectation Failed
{
  "code": 0,
  "message": "string"
}

3.2 Get Mail Validation Code

Send the verification code to the designated mailbox, send a successful return 200, and send the failure back to 417.

It is necessary to obtain the graphical verification code before sending the message verification code, which is passed through the verifyCode parameter.

Resource URI: /v1/identity/mail
Method: POST

Name

Definition

Type

Required

Describe

verifyCode

Graphics Validation Code

query

Yes.

mailAddress

Mailbox Address

body

Yes.

Mailbox address to receive verification code

Example request:

{
  "mailAddress": "test@edgegallery.org"
}

Example response:

response 200 OK

response 400 Bad Request
{
  "code": 0,
  "message": "string"
}

response 417 Expectation Failed
{
  "code": 0,
  "message": "string"
}

3.3 Get Graph Validation Code

Get picture data stream with verification code

Resource URI: /v1/identity/verifycode-image
Method: GET
  • The interface does not take any request parameters and returns the binary picture data stream

  • Validation is valid in 3 minutes

3.4 Precheck Graphic Validation Code Accuracy

pre-checking if the verification code input by the user is correct

Resource URI: /v1/identity/verifycode-image/precheck
Method: GET

Name

Definition

Type

Required

Describe

verifyCode

Graphics Validation Code

query

Yes.

Example response:

response 200 OK
{
  "checkResult": true
}