Updated on 2025-07-14 GMT+08:00

Querying Users

Function

Queries desktop users.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v2/{project_id}/users

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

user_name

No

String

Desktop username. The value contains 1 to 20 characters and cannot contain special characters or start with a digit.

limit

No

String

Limits the quantity of returned users in pagination query. If this parameter is not specified, all users who meet the query criteria are returned.

offset

No

String

Start number of records in pagination query.

description

No

String

User description query (fuzzy match).

active_type

No

String

Activation type, which defaults to activation by users.

  • USER_ACTIVATE: activated by users

  • ADMIN_ACTIVATE: activated by the administrator

group_name

No

String

Desktop user group name (exact match).

share_space_subscription

No

Boolean

Whether the user has subscribed to collaboration. The options are true (yes) and false (no).

share_space_desktops

No

Boolean

Whether the user has been bound to a collaborative desktop. The options are true (yes) and false (no).

is_query_total_desktops

No

Boolean

Whether to query the number of desktops bound to a user. The options are true (default) and false.

enterprise_project_id

No

String

Enterprise project ID.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Content-Type

Yes

String

MIME type of the request body, for example, application/json.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_count

Integer

Total number of users.

users

Array of User objects

User list.

Table 5 User

Parameter

Type

Description

id

String

User ID.

sid

String

User ID.

user_name

String

Desktop username.

user_email

String

User mailbox.

total_desktops

Integer

Total number of cloud desktops bound to a user.

user_phone

String

Mobile number.

active_type

String

Activation type, which defaults to activation by users.

  • USER_ACTIVATE: activated by users

  • ADMIN_ACTIVATE: activated by the administrator

is_pre_user

Boolean

Whether the user is pre-created.

account_expires

String

Account expiration time. 0 indicates that the account never expires.

password_never_expired

Boolean

Whether the password never expires. The options are true (never expires) and false (will expire).

account_expired

Boolean

Whether the account has expired. The options are true (yes) and false (no).

enable_change_password

Boolean

Whether the password can be changed. The options are true (yes) and false (no).

next_login_change_password

Boolean

Whether the password needs to be reset upon the next login. The options are true (yes) and false (no).

description

String

User description.

locked

Boolean

Whether the account is locked. The options are true (yes) and false (no).

disabled

Boolean

Whether the account is disabled. The options are true (yes) and false (no).

share_space_subscription

Boolean

Whether the user has subscribed to collaboration. The options are true (yes) and false (no).

share_space_desktops

Integer

Number of collaborative desktops bound to the user.

group_names

Array of strings

Groups that users join.

enterprise_project_id

String

Enterprise project ID.

user_info_map

String

User information mapping, including the service level, operation mode and type.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 405

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 503

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Example Requests

GET /v2/0bec5db98280d2d02fd6c00c2de791ce/users?limit=10

Example Responses

Status code: 200

Response to the request for querying Workspace users.

{
  "total_count" : 2,
  "users" : [ {
    "id" : "8a2c3f9579d240820179d51e6caf0001",
    "user_name" : "api-test",
    "user_email" : "test@huawei.com",
    "total_desktops" : 0,
    "account_expires" : "0",
    "enable_change_password" : true,
    "next_login_change_password" : true,
    "locked" : false,
    "disabled" : false
  }, {
    "id" : "8a2c3f9579d240820179d51e6caf0002",
    "user_name" : "api-test2",
    "user_email" : "test@huawei.com",
    "total_desktops" : 0,
    "account_expires" : "0",
    "enable_change_password" : true,
    "next_login_change_password" : true,
    "locked" : false,
    "disabled" : false
  } ]
}

Status Codes

Status Code

Description

200

Response to the request for querying Workspace users.

400

The request cannot be understood by the server due to malformed syntax.

401

Authentication failed.

403

No operation permissions.

404

No resources found.

405

The method specified in the request is not allowed.

500

An internal service error occurred. For details, see the error code description.

503

Service unavailable.

Error Codes

See Error Codes.