Get Assets by Organization¶
Get all the resources that a specified user can access under a specified OU.
Prerequisites¶
The OU has obtained the application, or the application is a self-built application in the OU.
The application has been granted the permission “Obtain all user permissions in the OU”. If necessary, contact the OU administrator to get the permission.
Request Format¶
POST https://{apigw-address}/app-portal-service/v2.2/user/asset/list
Request Parameters (Body)¶
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
userId |
Required |
String |
The user ID. How to get userId >> |
orgId |
Required |
String |
The OU ID which the asset belongs to. How to get orgId >> |
pagination |
Optional |
Pagination Request Struct |
Lists the paging requirements in a request. If not specified, the default pagination size is 1000 pages, starting from 0. Pagination Request Struct >> |
resourceTypes |
Optional |
Array |
Filtering resources by resource type, supporting up to 1000 types. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
pagination |
Pagination Struct |
The pagination information. Pagination Struct >> |
assets |
Assets Struct |
The list of the assets’ information. Assets Struct >> |
Pagination Struct¶
Name |
Data Type |
Description |
---|---|---|
pageNo |
Integer |
The request pages. |
pageSize |
Integer |
The number of records in each page. |
totalElements |
Long |
The total number of records. |
Assets Struct¶
Name |
Data Type |
Description |
---|---|---|
id |
String |
The asset ID. |
name |
I18nString |
The asset’s name in multiple languages. |
type |
String |
The code of the source Type. |
typeName |
I18nString |
The type name in multiple languages. |
Error Codes¶
Code |
Description |
---|---|
31400 |
User ID and OU ID are required. |
31403 |
The application has no access to user information or asset information. |
31404 |
The user is not found, or not in the OU. |
Samples¶
Request Sample¶
url: https://{apigw-address}/app-portal-service/v2.2/user/asset/list
method: POST
{
"userId": "yourUserId",
"orgId": "yourOrgId",
"resourceTypes": ["type1", "type2"],
"pagination": {
"pageNo": 0,
"pageSize": 1000,
}
}
Response Sample¶
{
"code": 0,
"message": "OK",
"data": {
"pagination": {
"totalElements": 1,
"pageNo": 0,
"pageSize": 1000
},
"assets": [
{
"id": "your_asset_id",
"name": {
"default": "autoTree",
"en_US": "autoTree_EN",
"zh_CN": "",
"es_ES": "",
"ja_JP": ""
},
"type": "auth_unit",
"typeName": {
"default": "Physical Resource",
"en_US": "Physical Resource",
"zh_CN": ""
}
}
]
}
}