Get Users UserGroup List


Get the user groups of users in batch. You can search up to 1000 users at one time.

Prerequisites


The application has been granted the permission “Obtain all user permissions in the OU”. Contact the OU administrator to get the permission if necessary.

Request Format


POST https://{apigw-address}/app-portal-service/v2.2/userGroup/getUsersUserGroupList

Request Parameters (Body)


Name

Required/Optional

Data Type

Description

organizationId

Required

String

The OU ID. How to get organizationId >>

userIds

Required

List

The list of user IDs, supporting up to 1000 IDs. How to get userId >>

Response Parameters


Name

Data Type

Description

usersUserGroups

UsersUserGroupsDTO Struct

The information about users and their corresponding user groups. UsersUserGroupsDTO Struct >>

userGroups

UserGroupInfoDTO Struct

The user group information. UserGroupInfoDTO Struct >>

UsersUserGroupsDTO Struct


Name

Data Type

Description

userId

String

The user ID.

userGroupIds

List

The list of user group IDs.

UserGroupInfoDTO Struct


Name

Data Type

Description

id

String

The asset ID.

name

String

The user group name.

Error Codes


Code

Description

31400

Errors such as incorrect parameters, empty parameters, character limits exceeded, and so on.

31403

The application has not been granted the “Obtain all user permissions in the OU” permission.

31404

OU not found, or some users not found in the OU.

Samples

Request Sample


url: https://{apigw-address}/app-portal-service/v2.2/userGroup/getUsersUserGroupList

method: POST

requestBody:
{"organizationId":"yourOrgId","userIds": ["user1","user2","user3"]}

Return Sample


{
  "code": 0,
  "message": "OK",
  "data": {
    "usersUserGroups": [
      {
        "userId": "your_user_id",
        "userGroupIds": [
          "your_user_group_id_1",
          "your_user_group_id_2",
          "your_user_group_id_3",
          "your_user_group_id_4",
          "your_user_group_id_5"
        ]
      }
    ],
    "userGroups": [
      {
        "name": "your_user_group_name_1",
        "id": "your_user_group_id_1"
      },
      {
        "name": "your_user_group_name_2",
        "id": "your_user_group_id_2"
      },
      {
        "name": "your_user_group_name_3",
        "id": "your_user_group_id_3"
      },
      {
        "name": "your_user_group_name_4",
        "id": "your_user_group_id_4"
      },
      {
        "name": "your_user_group_name_5",
        "id": "your_user_group_id_5"
      }
    ]
  }
}