Updated on 2024-12-30 GMT+08:00

Querying the User List

Function

This API is used to query the user list.

Constraints

null

URI

GET /api/v2/tenant/users

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

org_id

Yes

String

Organization ID. The value can be null, which means querying all users.

offset

Yes

Integer

Page number.

limit

Yes

Integer

Number of data records on each page.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Authorization

Yes

String

Authentication credential. The value is "Bearer {access_token}". access_token is obtained by calling the API for obtaining an access credential.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total

Long

Total number of users.

users

Array of UsersDetailsResult objects

User list.

Table 4 UsersDetailsResult

Parameter

Type

Description

user_id

String

User ID.

org_id

String

Organization to which the user belongs.

user_name

String

Username.

name

String

Real name.

mobile

String

Mobile number.

email

String

Email address.

pwd_must_modify

Boolean

Whether the password must be changed upon the first login.

pwd_change_at

String

Password change time.

created_at

String

Creation time.

updated_at

String

Last modification time.

disabled

Boolean

Whether disabled.

grade

Integer

Trust level.

locked

String

Whether locked.

extension

Object

Custom extended attribute.

user_org_relation_list

Array of UserOrgRelationListResult objects

User organization relationship set.

Table 5 UserOrgRelationListResult

Parameter

Type

Description

org_id

String

Organization ID.

relation_type

String

Relationship type.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error details.

Example Requests

Query the first 10 users for all organizations.

GET https://{domain_name}/api/v2/tenant/users?org_id=&offset=0&limit=10

Authorization: Bearer 334963fc-1e4a-473b-9096-52a929140...

Example Responses

Status code: 200

Request successful.

{
  "total" : 1,
  "users" : [ {
    "extension" : { },
    "user_name" : "zhangsan",
    "mobile" : "12345678901",
    "created_at" : "2022-03-31 16:46:02.964",
    "pwd_must_modify" : false,
    "updated_at" : "2022-03-31 16:48:44.073",
    "user_id" : "20220331164602949-904C-D475B60AE",
    "org_id" : "20220331135144180-0FA5-EE3B69068",
    "grade" : 1,
    "name" : "zhangsan",
    "disabled" : false,
    "pwd_change_at" : "2022-03-31 16:47:51.481",
    "locked" : false,
    "user_org_relation_list" : [ {
      "org_id" : "20220331135144180-0FA5-EE3B69068",
      "relation_type" : 1
    }, {
      "org_id" : "20220415103506608-AF59-5CC9081B9",
      "relation_type" : 0
    } ]
  } ]
}

Status Codes

Status Code

Description

200

Request successful.

400

Invalid parameter.

Error Codes

See Error Codes.