ApiAsset
Get asset tree
Returns the hierarchical asset tree for the requested view (normal, published, draft, unassigned, or inactive).
Access restricted to roles:
- admin
- manufacturer-admin
- manufacturer-user
- producer-admin
- producer-user
Query Parameters
view*string
Filter by view: normal (published and part of a location-rooted tree), published (all non-draft assets, active or inactive, independent of assignment), unassigned (published but not part of a location-rooted tree), inactive (deactivated), or draft (unpublished).
Value in
"normal" | "unassigned" | "inactive" | "draft" | "published"Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://test.sweetconnect.io/api/asset/v1/assets/tree?view=normal"{
"data": [
{
"id": "0c1b9613-7d6f-40b7-bf29-3179ac401fc9",
"assetType": "location",
"custom": false,
"active": true,
"machineConnection": true,
"name": "Sample Asset",
"imageUrl": "https://example.com/asset.jpg",
"position": 0,
"parentId": "0c1b9613-7d6f-40b7-bf29-3179ac401fc9",
"children": [
{
"id": "0c1b9613-7d6f-40b7-bf29-3179ac401fc9",
"assetType": "location",
"custom": false,
"active": true,
"machineConnection": true,
"name": "Sample Asset",
"imageUrl": "https://example.com/asset.jpg",
"position": 0,
"parentId": "0c1b9613-7d6f-40b7-bf29-3179ac401fc9",
"children": [],
"serialNumber": "SN-12345"
}
],
"serialNumber": "SN-12345"
}
]
}{
"errors": [
{
"errorCode": "BadRequest",
"message": "The request payload is invalid.",
"extension": {}
}
]
}{
"errors": [
{
"errorCode": "Unauthorized",
"message": "Authentication is required to access this resource.",
"extension": {}
}
]
}{
"errors": [
{
"errorCode": "NoPermission",
"message": "You do not have permission to access this resource.",
"extension": {}
}
]
}{
"errors": [
{
"errorCode": "InternalServerError",
"message": "An unexpected internal server error occurred.",
"extension": {}
}
]
}