Skip to content

List user Groups

1. API Description

Use this API to query user groups.

2. API URL

POST http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/userGroup/list

To obtain anymetrics_host:anymetrics_port, see Calling APIs.

3. Common Request Headers

parameter Type required Description
tenant-id String Yes Tenant ID that identifies the tenant to which the resource belongs.
auth-type String Yes Authentication method. Supports UID, TOKEN, ACCOUNT, and APIKEY.
auth-value String Yes Authentication value corresponding to auth-type.

3.1 How to Obtain Common parameters

In Aloudata CAN, select Metric Applications in the top navigation bar, then select API Integration in the left navigation menu. You can obtain tenant-id on the API Integration page. Set auth-value according to auth-type.

image.png

3.2. Request Body parameters:

parameter Type required Description
keyword String No Search keyword
groupIdentityType String required when groupIds is not empty user group identifier type (USER_GROUP_ID or USER_GROUP_CODE)
groupIds Array No List of user group IDs or codes
pageNumber Integer Yes Page number
pageSize Integer Yes Page size

4. Request Example:

curl --location 'http://localhost:8083/anymetrics/api/v1/userGroup/list' \
--header 'tenant-id: tn_21571046' \
--header 'auth-value: authority_test' \
--header 'auth-type: ACCOUNT' \
--header 'Content-Type: application/json' \
--data '{
  "keyword": "Sales",
  "groupIdentityType": "USER_GROUP_ID",
  "groupIds": ["g_1001", "g_1002"],
  "pageNumber": 1,
  "pageSize": 20
}'

5. Response Example:

{
  "data": [
    {
      "groupId": "g_1001",
      "name": "East China Sales Group",
      "description": "East China regional sales staff",
      "parentGroupId": "g_root",
      "code": "EAST_SALES"
    }
  ],
  "total": 120,
  "pageNumber": 1,
  "pageSize": 20
}