Get Assets by Application


Get all the assets that the current user can access under a specified application.

Operation Permissions


  • User login to Application Portal is required.
  • Selecting an OU is required.

Prerequisites


  • The associated application has been acquired by the organization.
  • The associated application must have access permissions (authorized by the organization administrator) for the assets.

Request Format


GET https://{apigw-address}/app-portal-service/v2.2/user/app/asset/tree

Request Parameters (URI)


Name Mandatory/Optional Data Type Description
accessKey Mandatory String The service account of the application. The application authenticates with accessKey to obtain the data that it is authorized to access. How to get accessKey>>
resourceTypes Optional String Filtering resources by the specified resource types, supporting up to 1000 types.

Request Parameters (Header)


Name Mandatory/Optional Data Type Description
Authorization Mandatory String The access token (or bearer token). The format of the parameter’s string is Bearer {your token}. Refer to Log In or Refresh Access Token to learn how to get the access token.
needAssociatedAsset Optional Boolean Return the resource information associated to the organization structure node. true for to return, false for not to return.

Response Parameters


Name Data Type Description
data Data Struct The list of the assets

Data Struct


Name Data Type Description
id String The node ID
name String The node name
tag String The tag of a node. “Asset” will mean the node is an asset with a parent node that is also an organizational structure node (because an asset can only be mounted on the leaf node of the organizational structure), and “null” will mean the node is an organizational structure node
tags List<StructureTagDTO> The tag of organization structures
displayorder Integer The serial number of display order
nameJson I18nString The organization structure name in Json, supporting multiple languages
data.type String Resource Type Identifier. The parameter is only available when the current node is a resource. If the current node is an organization structure node, the value will be null.
data.typeName I18nString Resource Type name. The parameter is only available when the current node is a resource. If the current node is an organization structure node, the value will be null.
parentId String The parent node ID
children Data Struct The child nodes
associatedResources Data Struct The resource associated with the node.

StructureTagDTO Struct


Name Data Type Description
id Integer The serial number of organization structure tags
key String The key of organization structure tags
value String The value of organization structure tags

Error Codes


Code Description
31400 AccessKey is required
31401 Access Token is invalid
31403 No access to the application
31404 The application does not exist, or the organization does not acquire the application
31512 Selecting an OU is required

Samples

Request Sample


url: https://{apigw-address}/app-portal-service/v2.2/user/app/asset/tree?accessKey=your_access_key&resourceTypes=type1,type2

method: GET

headers: {"Authorization":"Bearer your_access_token"}

Return Sample


{
  "code": 0,
  "data": {
    "children": [
      {
        "children": [
          {
            "displayOrder": -1,
            "id": "your_asset_id",
            "name": "your_asset_name",
            "nameJson": {
              "default": "your_asset_name_default",
              "en_US": "your_asset_name_en",
              "zh_CN": "your_asset_name_zh",
              "es_ES": "your_asset_name_es",
              "ja_JP": "your_asset_name_jp"
            },
            "parentId": "",
            "tag": "asset",
            "type": "auth_unit",
            "typeName": {"default":"your_asset_type_default","en_US":"your_asset_type_en","zh_CN":"your_asset_type_zh"}}
          }
        ],
        "displayOrder": 0,
        "id": "your_asset_id",
        "name": "your_asset_name",
        "nameJson": {
          "default": "your_asset_name_default",
          "en_US": "your_asset_name_en",
          "zh_CN": "your_asset_name_zh"
        },
        "parentId": "your_node_id",
        "tags": [
          {
            "id": 123,
            "key": "your_tag_key",
            "value": "your_tag_value"
          }
        ]
      }
    ],
    "displayOrder": 0,
    "id": "your_asset_id",
    "name": "your_asset_name",
    "nameJson": {
      "default": "your_asset_name_default",
      "en_US": "your_asset_name_en",
      "zh_CN": "your_asset_name_zh"
    },
    "parentId": "",
    "tags": []
  },
  "message": "OK"
}