Metric
Metric
Fetch metrics by providing the arguments in the request body
# Example of segment-size metrics
curl -s -XPOST "$LIOAPI/api/metric" \
-H 'Content-type: application/json' \
-H "Authorization: $LIOKEY" \
-d '{
"dimension": "segsize",
"dimension_id": "abc123",
"dimension_type": "size",
"interval": "2h",
"aggregation": "max",
"start_date": "now-5d",
"end_date": "now",
"smooth": true
}' | jq '.'
# Example request of data collected from the default and email stream
curl -s -XPOST "$LIOAPI/api/metric" \
-H "Content-type: application/json" \
-H "Authorization: $LIOKEY" \
-d '[{
"dimension": "stream",
"dimension_id": "default",
"dimension_type": "size",
"interval": "1h",
"aggregation": "sum",
"start_date": "now-1w",
"end_date": "now"
},
{
"dimension": "stream",
"dimension_id": "email",
"dimension_type": "size",
"interval": "1h",
"aggregation": "sum",
"start_date": "now-2w",
"end_date": "now"
}]' | jq '.'
post/api/metric
Request
- Base URLhttps://api.lytics.io
- URLhttps://api.lytics.io/api/metric
- AuthAPI key in header Authorization
Query parameters
account_idstring
Your Lytics account ID.
Request body
Example request
{
"dimension": "segsize",
"dimension_id": "default",
"dimension_type": "size",
"interval": "2h",
"aggregation": "max",
"startdate": "now-5d",
"enddate": "now"
}Response
OK
Example response
{
"data": [
{
"name": "sample-request",
"dimension": "segsize",
"dimension_id": "abc123",
"dimension_type": "size",
"range": "2d",
"aggregation": "max",
"interval": "2h",
"is_cached": true,
"values": [
{
"value": 0,
"ts": "1525231674371"
},
{
"value": 100,
"ts": "1525238874371"
},
{
"value": 200,
"ts": "1525246074371"
},
{
"value": 300,
"ts": "1525253274371"
},
{
"value": 400,
"ts": "1525260474371"
},
{
"value": 500,
"ts": "1525267674371"
},
{
"value": 600,
"ts": "1525274874371"
},
{
"value": 700,
"ts": "1525282074371"
},
{
"value": 800,
"ts": "1525289274371"
},
{
"value": 900,
"ts": "1525296474371"
}
]
}
],
"message": "success",
"status": 200
}Changes
No recorded changes to this operation across all 1 revision of this API.