How to retrieve status for all usage report requests
This tutorial shows how to retrieve the usage report status for all reports.
The Report Creation Async API retrieves the status of all usage report requests and returns them in the response. When the status report completes, you can download it using the download URL from the email notification sent by the response.
API response records sort based on the creation date in ascending or descending order. You can add this in your request using the sort parameter. If the sort parameter isn't used in the request, the records default to sorting in descending order.
This example uses org123456789 as the realmId.
GET https://usage.bam.api.here.com/v2/usage/realms/org123456789/reportsParameters
The parameters shown here are only those required for this sample request. For a complete list of parameters, see the Cost Management Usage API v2 API Reference.
The response groups usage search results into pages. A page is a set of usage records presented in a single view. You can customize the search results view by using the offset and limit parameters. The offset parameter determines the current page number on the view, and the limit parameter restricts search result counts to a specified number.
| realmId required | string [ 5 ... 30 ] characters. Example: org123456789 Your partner organization ID. |
| limit | integer [ 1 ... 100 ]. Default: 100 The number of records returned. The default and maximum is 100 records. |
| sort | string Default: "desc" Enum: "asc" "desc" The status for each report returns in ascending or descending order depending on the creation date. |
| offset | integer greater than or equal to zero. Default: 0 Offset page number. |
Header parameters
| X-Request-ID | string User-provided token to trace a request or a group of requests sent to the service. |
| X-Correlation-ID required | string Auto-generated ID, which uniquely identifies the request, available in the response. When contacting the support team with an inquiry regarding a specific request, provide the value of this header. This helps when troubleshooting the issue. |
Response HTTP 200 The request returns the following sample response:
{
"total": 18,
"limit": 5,
"count": 2,
"nextOffset": 0,
"lastOffset": 3,
"items":
[
{
"id": "REPORT-100",
"status": "inProgress",
"created": "2022-03-01'T'00:00:00",
"parameters":
{
"realm": "org1879256",
"startDate": "2022-03-01'T'00:00:00",
"endDate": "2022-07-01'T'00:00:00",
"emailId": "[email protected]"
}
},
{
"id": "REPORT-145",
"status": "completed",
"resultHref": "https://usage/realms/org236848/report/REPORT-1475/output",
"created": "2022-04-01'T'00:00:00",
"parameters":
{
"realm": "org1879256",
"startDate": "2022-03-01'T'00:00:00",
"endDate": "2022-07-01'T'00:00:00",
"emailId": "[email protected]"
}
},
{
"id": "REPORT-167",
"status": "failed",
"created": "2022-08-01'T'00:00:00",
"parameters":
{
"realm": "org1879586",
"startDate": "2022-03-01'T'00:00:00",
"endDate": "2022-07-01'T'00:00:00",
"emailId": "[email protected]"
}
}
]
}Updated last month