/aggregates

GET
https://sample-api.d-velop.cloud
Returns daily or monthly usage aggregates for an app and metric in the current tenant. Every authenticated service or user may currently query all apps and metrics in its tenant.
Parameters
Responses
200
Successfully returned the usage aggregates.
Content
Media type: application/json
{
  "tenantId": {
    "type": "string"
  },
  "appId": {
    "type": "string"
  },
  "usageType": {
    "type": "string"
  },
  "label": {
    "type": "string"
  },
  "aggregation": {
    "type": "string",
    "enum": [
      "sum",
      "count"
    ]
  },
  "bucketType": {
    "type": "string",
    "enum": [
      "DAY",
      "MONTH"
    ]
  },
  "from": {
    "type": "string",
    "format": "date"
  },
  "to": {
    "type": "string",
    "format": "date"
  },
  "unit": {
    "type": "string"
  },
  "total": {
    "type": "number",
    "format": "double"
  },
  "series": {
    "type": "array",
    "items": {
      "type": "object",
      "required": [
        "date",
        "value",
        "eventCount",
        "missing"
      ],
      "properties": {
        "date": {
          "type": "string",
          "description": "The bucket date in YYYY-MM-DD format for DAY buckets or YYYY-MM format for MONTH buckets."
        },
        "value": {
          "type": "number",
          "format": "double"
        },
        "eventCount": {
          "type": "integer",
          "format": "int64"
        },
        "missing": {
          "type": "boolean",
          "description": "Indicates that no aggregate exists for this bucket."
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "nullable": true
        }
      }
    }
  }
}
400
Bad Request
No content
401
Unauthorized
No content
403
Forbidden
No content
406
Not Acceptable
No content
500
Internal Server Error
No content
Show operation

Language

const options = {method: 'GET', headers: {accept: 'application/json'}};

fetch('https:///%3Ctenant-base-uri%3E/consumptiontracker/api/v1/aggregates', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));