Unify and manage your data

Retrieve daily task usage summary

Use this API to retrieve a summary of task usage for each day in the specified time range. The response includes total tasks executed, successful tasks, and failed tasks for each report date.

HTTP method and endpoint

Use the following HTTP method and endpoint path to submit the request for retrieving daily task usage data.
POST /statistics-reporting/{tenantId}/API/getDailyTaskUsage

Replace {tenantId} with the ID of the target tenant.

Request headers

The following request headers must be included.

HeaderValueRequired
Content-Typeapplication/jsonYes
AuthorizationBearer {access_token}Yes

Request body

The following table describes the request body parameters, including accepted values and defaults.

ParameterTypeRequiredDescriptionAccepted values / Default
from (1)LongYesStart time in epoch milliseconds
to (1)LongYesEnd time in epoch milliseconds
envStringYesTarget environment

Example: prod, qa, dev

Default: none

Note:
  1. The time range defined by the from and to values must not exceed one month. If the specified range exceeds the allowed limit, the API returns an HTTP 416 Range Not Satisfiable error with the following response:
    {
      "errors": [
        {
          "message": "Invalid time range."
        }
      ]
    }
    

Example request

Use the following example to see how a complete request is structured with headers and a JSON body.
curl -X POST https://{baseUrl}/statistics-reporting/{tenantId}/API/getDailyTaskUsage \
  -H "Authorization: Bearer YOUR_BEARER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "from": 1721012400000,
    "to": 1721108800000,
    "env": "prod"
  }'

Response fields

The following table describes the fields returned in the response body.

FieldTypeDescription
reportDateStringDate in YYYY-MM-DD format for which the task usage data was collected
totalIntegerTotal number of tasks (successful + failed) for the specified date
successIntegerNumber of successfully completed tasks for the specified date
failedIntegerNumber of failed tasks for the specified date

Example response

The following example shows task usage statistics for two days, including success and failure counts.
[
  {
    "reportDate": "2023-10-24",
    "total": 245,
    "success": 232,
    "failed": 13
  },
  {
    "reportDate": "2023-10-25",
    "total": 207,
    "success": 201,
    "failed": 6
  }
]