Create Asset Tree and Associate Asset¶
Create an asset tree and link an existing asset as the root node of the asset tree. The asset to be linked can be a device asset or a non-device (logical) asset.
Operation Permissions¶
Required Authorization  | 
Required Operation Permission  | 
|---|---|
Asset Tree Management  | 
Full Access  | 
Request Format¶
POST https://{apigw-address}/asset-tree-service/v2.1/asset-trees?action=associate
Request Parameters (URI)¶
Note
Use one of the following methods to identify the asset to be linked.
Include the
assetIdin the requestInclude both
productKeyanddeviceKeyin the request
Name  | 
Location (Path/Query)  | 
Mandatory/Optional  | 
Data Type  | 
Description  | 
|---|---|---|---|---|
orgId  | 
Query  | 
Mandatory  | 
String  | 
The organization ID which the asset belongs to. How to get orgId>>  | 
assetId  | 
Query  | 
Optional (See Note above)  | 
String  | 
The asset ID. How to get assetID>>  | 
productKey  | 
Query  | 
Optional (See Note above)  | 
String  | 
The product key. To be used with   | 
deviceKey  | 
Query  | 
Optional (See Note above)  | 
String  | 
The device key. To be used with   | 
Request Parameters (Body)¶
Name  | 
Mandatory/Optional  | 
Data Type  | 
Description  | 
|---|---|---|---|
tree  | 
Optional  | 
TreeCreateVo Struct  | 
The details of the asset tree to be created. For more details, see TreeCreateVo Struct  | 
Response Parameters¶
Name  | 
Data Type  | 
Description  | 
|---|---|---|
data  | 
String  | 
The created asset tree ID.  | 
Error Codes¶
Code  | 
Message  | 
Description  | 
|---|---|---|
17772  | 
The quota of tree reaches ceiling  | 
Number of trees already reaches maximum of the OU.  | 
99400  | 
Invalid arguments  | 
The request parameter is invalid. Check the request parameters.  | 
99500  | 
System error  | 
Internal server error. Contact EnOS support.  | 
Samples¶
Request Sample¶
url: https://{apigw-address}/asset-tree-service/v2.1/asset-trees?action=associate&orgId=yourOrgId&assetId=yourAssetId
method: POST
requestBody:
{
    "tree":{
        "name":{
            "defaultValue":"Name"
        }
    }
}
Return Sample¶
{
    "code": 0,
    "msg": "OK",
    "requestId": "01b5477a-374e-49a0-8b68-7dbfe8f0b74f",
    "data": "cRUdS7sJ"
}