Check Asset Permission


Check if the user has permission for the specified asset.

Prerequisites


The user has logged in to Application Portal and entered an OU. You can log in to Application Portal through the Log In API and select the OU through the Choose Organization API.

Request Format


POST https://{apigw-address}/app-portal-service/v2.2/user/authorization/asset/check

Request Parameters (Header)


Name

Required/Optional

Data Type

Description

Authorization

Required

String

The access token generated after the user logs in and selects the OU, represented by Bearer Token, is in the form of Bearer {your token}. You can call the Log In or Refresh Access Token API to obtain the access token.

Request Parameters (Body)


Name

Required/Optional

Data Type

Description

assetIds

Required

String

The asset ID. Supports the query of multiple asset IDs, separated by commas. How to get assetId >>

Response Parameters


Name

Data Type

Description

data

Boolean

Whether the user has the permission to view the assets. true indicates that the user has the permission to view all the queried assets, false indicates that the user has no permission to view some or all of the assets.

Error Codes


Code

Description

31400

Asset ID is required

31401

Access Token is invalid

31512

Selecting an OU is required

Samples

Request Sample


url: https://{apigw-address}/app-portal-service/v2.2/user/authorization/asset/check

method: POST

headers: {"Authorization":"Bearer your_token"}

requestBody:
{
  "assetIds": [
    "your_asset_id_1",
    "your_asset_id_2",
    "your_asset_id_3",
    "your_asset_id_4",
    "your_asset_id_5",
    "your_asset_id_6",
    "your_asset_id_7"
  ]
}

Return Sample


{
  "code": 0,
  "message": "",
  "data": false
}