Get Asset Structure

Get the upstream organizational structure where the asset is located.

Operation Permissions

User login to Application Portal is required.

Request Format

GET https://{apigw-address}/app-portal-service/v2.1/asset/structure

Request Parameters (URI)

Name

Location (Path/Query)

Mandatory/Optional

Data Type

Description

assetIds

Query

Mandatory

String

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

Request Parameters (Header)

Name

Mandatory/Optional

Data Type

Description

Authorization

Mandatory

String

The access token (or bearer token). Refer to Log In or Refresh Access Token to learn how to get the access token.

Response Parameters

Name

Data Type

Description

data

Data Struct

The organizational structure.

Data Struct

Name

Data Type

Description

structures

AssetStructure Struct

The list of the organizational structure tree.

AssetStructure Struct

Name

Data Type

Description

id

String

The organizational structure ID.

name

String

The organizational structure name.

description

String

The organizational structure description.

orgId

String

The organizational ID where the organizational structure is located.

children

AssetStructure Struct

The sub-organizational structure.

Samples

Request Sample

url: https://{apigw-address}/app-portal-service/v2.1/asset/structure?assetId=Dqp9GZsT
method: GET
requestHeader:
{
  "Authorization":"yourBearerToken"
}

Return Sample

{
  "code": 200,
  "data": {
    "structures": [
      {
        "children": [],
        "description": "",
        "displayName": "wyf",
        "id": "sg1566xxxxxxxxxx",
        "name": "wyf",
        "orgId": "yourOrgId"
      }
    ]
  },
  "message": ""
}

Java SDK Sample

public class AppPortalSdkTest{
    @Test
    public void getAssetStructureTest() {
        AssetStructureRequest assetStructureRequest = new AssetStructureRequest("your_asset_id", "your_access_token");
        AssetStructureResponse assetStructureResponse = Poseidon.config(PConfig.init().appKey("your_access_key").appSecret("your_secret_key").debug())
                .url("https://{apigw-address}").getResponse(assetStructureRequest, AssetStructureResponse.class);

        System.out.println("Asset Structure res: " + JSON.toJSONString(assetStructureResponse));

        assertNotNull("Response should not be null", assetStructureResponse);
        assertNotNull("Response data should not be null", assetStructureResponse.data);
        assertNotNull("Structure could not be null", assetStructureResponse.data.structures.size());
    }

}