Help Center/ Workspace/ API Reference/ Workspace APIs/ User Group/ Querying Users in a User Group
Updated on 2024-01-10 GMT+08:00

Querying Users in a User Group

Function

Query users in a user group.

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}/groups/{group_id}/users

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

group_id

Yes

String

User group ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

user_name

No

String

The username supports fuzzy search.

description

No

String

The user description supports fuzzy search.

active_type

No

String

Activation type.

  • USER_ACTIVATE: activated by the user.

  • ADMIN_ACTIVATE: activated by the administrator.

limit

No

String

Maximum number of desktops that can be returned in a pagination query. If this parameter is not specified or is set to 0, the default value 2000 is used. The maximum value is 2000.

offset

No

String

Start position for pagination query. The value starts from 0.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

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

users

Array of UserInGroup objects

Users associated with the group.

total_count

Integer

Total number of users in the user list.

Table 5 UserInGroup

Parameter

Type

Description

id

String

User ID.

user_name

String

Desktop username.

user_email

String

User mailbox.

user_phone

String

Mobile number of the user.

description

String

User description.

Example Requests

None

Example Responses

Status code: 200

Response to the list of users associated with the group.

{
  "total_count" : 2,
  "users" : [ {
    "user_name" : "user1",
    "user_email" : "xx1@mail.com",
    "user_phone" : "18818008887",
    "id" : "8357fd328c62447d94e452bf49xxxx"
  }, {
    "user_name" : "user2",
    "user_email" : "xx2@mail.com",
    "user_phone" : "18818008888",
    "id" : "8357fd328c62447d94e452bf495xxxx"
  } ]
}

Status Codes

Status Code

Description

200

Response to the list of users associated with the group.

Error Codes

See Error Codes.