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 '.'

Language
Authorization
Header
Click Try It! to start a request and see the response here!