POST
/
metrics
curl --request POST \
  --url https://api.togai.com/metrics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "startTime": "2017-07-21T00:00:00Z",
  "endTime": "2017-07-22T00:00:00Z",
  "metricQueries": [
    {
      "id": "m1",
      "name": "EVENTS",
      "aggregationPeriod": "DAY",
      "filters": [
        {
          "fieldName": "ACCOUNT_ID",
          "fieldValues": [
            "account#1"
          ]
        },
        {
          "fieldName": "CUSTOMER_ID",
          "fieldValues": [
            "customer#1"
          ]
        },
        {
          "fieldName": "EVENT_STATUS",
          "fieldValues": [
            "PROCESSED"
          ]
        }
      ]
    },
    {
      "id": "m2",
      "name": "USAGE",
      "aggregationPeriod": "MONTH",
      "filters": [
        {
          "fieldName": "CUSTOMER_ID",
          "fieldValues": [
            "customer#1"
          ]
        }
      ]
    }
  ]
}'
{
  "results": [
    {
      "id": "m1",
      "name": "EVENTS",
      "data": [
        {
          "timestamps": [
            "2017-07-21T00:00:00Z",
            "2017-07-22T00:00:00Z"
          ],
          "metricValues": [
            53,
            32
          ]
        }
      ]
    },
    {
      "id": "m2",
      "name": "USAGE",
      "data": [
        {
          "timestamps": [
            "2017-07-01T00:00:00Z"
          ],
          "metricValues": [
            123.45
          ]
        }
      ]
    }
  ]
}

MetricQuery: Allowed field combinations


Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
startTime
string
required

Start date time of the query (inclusive)

endTime
string
required

End date time of the query (exclusive)

metricQueries
object[]
required

Response

200 - application/json
results
object[]
required