ApiDatabus metrics
Get asset availability trend
Calculates the availability KPI broken down into time buckets.
Access restricted to roles:
- admin
- manufacturer-admin
- manufacturer-user
- producer-admin
- producer-user
- sales-agent
Authorization
bearer AuthorizationBearer <token>
In: header
Query Parameters
buckets?number
Number of intervals to divide the time range into
assetId?string
Optional asset identifier to filter the calculation
startDate?unknown
Start timestamp (e.g., '-24h')
endDate?unknown
End timestamp (e.g., 'now')
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://my.sweetconnect.io/api/databus/v1/metrics/availability"{
"buckets": [
{
"startDate": 0,
"endDate": 0,
"data": [
{
"assetId": "string",
"value": {},
"statistics": {
"data": {
"min": 12.4,
"max": 98.7,
"mean": 54.2,
"median": 52.9,
"p90": 91.3
},
"metadata": {
"minMachineId": "machine-001",
"maxMachineId": "machine-042"
}
},
"metadata": {}
}
]
}
],
"warnings": [
{
"errorCode": "HttpError",
"message": "Input is not valid",
"extension": {}
}
]
}{
"errors": [
{
"errorCode": "RequestValidationError",
"message": "The 'username' field is required.",
"extension": {
"type": "body",
"key": "username"
}
}
]
}{
"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 error occurred. See logs for further details or create a support ticket.",
"extension": {}
}
]
}