Get Users Asset List


Get the assets within the permissions of users. You can request 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/user/users/assetList

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 >>

resourceTypes

Optional

Array

Filtering resources by the specified resource types, supporting up to 1000 types. You can use the Get Resource Type API to get the resource type list.

Response Parameters


Name

Data Type

Description

usersUserAssets

UsersUserAssetsDTO Struct

The information about users and their corresponding assets. UsersUserAssetsDTO Struct >>

userAssets

UserAssetInfoDTO Struct

The asset information. UserAssetInfoDTO Struct >>

UsersUserAssetsDTO Struct


Name

Data Type

Description

userId

String

The user ID.

userAssetIds

List

The list of Asset IDs.

UserAssetInfoDTO Struct


Name

Data Type

Description

id

String

The asset ID.

name

I18nString

The asset name.

type

String

Resource Type code.

typeName

I18nString

Specify the type name in multiple languages. Internationalized name struct >>

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.

Samples

Request Sample


url: https://{apigw-address}/app-portal-service/v2.2/user/users/assetList

method: POST

{"organizationId":"yourOrgId",
"userIds": ["user1","user2","user3"],
"resourceTypes": ["type1", "type2"]}

Return Sample


{
  "code": 0,
  "message": "OK",
  "data": {
    "usersUserAssets": [
      {
        "userId": "your_user_id",
        "userAssetIds": [
          "your_asset_id"
        ]
      }
    ],
    "userAssets": [
      {
        "id": "resourceId",
        "name": {
          "default": "autoTree",
          "en_US": "autoTree",
          "zh_CN": "",
        },
        "type": "auth_unit",
        "typeName": {
          "default": "Physical Resource",
          "en_US": "Physical Resource",
          "zh_CN": ""
        }
      }
    ]
  }
}