The Get monthly analytics method is used to get information about monthly expenses for a subscription. The target period can be specified using arbitrary dates or aligned to billing periods. The method returns amounts in the reseller currency. The response depends on the service.
GET {{base_url}}/api/v3/analytics_monthly
Authentication
This endpoint requires a JWT access token. Specify the token in the Authorization header using the Bearer authentication scheme:
Authorization: Bearer <JWT_ACCESS_TOKEN>
In Postman, select Bearer Token on the Authorization tab and enter the JWT access token.
Arguments
|
Name |
Parameter Type |
Data type |
Required/
|
Description |
|---|---|---|---|---|
|
Content-Type |
header |
string |
Required |
Media type of the request. Specify the following: application/vnd.api+json |
|
Accept |
header |
string |
Required |
Supported media types of the answer. Specify the following: application/vnd.api+json |
|
base_url |
path |
string |
Required |
ActivePlatform URL |
|
subscription_id |
query |
string |
Required |
The subscription ID |
|
period_from |
query |
string |
Optional |
The first billing period (YYYY-MM) |
|
period_to |
query |
string |
Optional |
The last billing period (YYYY-MM) |
|
date_from |
query |
string |
Required |
The first day of the target period (YYYY-MM-DD) |
|
date_to |
query |
string |
Required |
The last day of the target period (YYYY-MM-DD) |
Response model
|
Name |
Data type |
Description |
||||||
|---|---|---|---|---|---|---|---|---|
|
billing_periods |
array |
The list of billing periods (YYYY-MM) |
||||||
|
subscription |
object |
Information about the subscription |
||||||
|
|
id |
integer |
The subscription ID |
|||||
|
|
items |
array |
The list of resources and expenses |
|||||
|
|
|
resource_group |
string |
The resource name group |
||||
|
|
|
category |
string |
The resource category |
||||
|
|
|
resource_name |
string |
The resource name |
||||
|
|
|
tags |
array |
The list of resource tags |
||||
|
|
|
billing_period |
string |
The billing period (YYYY-MM) |
||||
|
|
|
total |
string |
The consumption amount |
||||
Request example
GET /api/v3/analytics_monthly?subscription_id=53840&period_from=2023-06&period_to=2023-07
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
Authorization: Bearer <JWT_ACCESS_TOKEN>
Accept: application/vnd.api+json
Response example
{
"billing_periods": [
"2023-06",
"2023-07"
],
"subscription": {
"id": "53840",
"items": [
{
"resource_group": "PDFParanaGLM",
"category": "Storage",
"resource_name": "Batch Write Operations",
"tags": [],
"billing_period": "2023-06",
"total": "0.0"
},
{
"resource_group": "PDFParanaGLM",
"category": "Storage",
"resource_name": "LRS Data Stored",
"tags": [],
"billing_period": "2023-06",
"total": "0.898459"
},
{
"resource_group": "RGLAN",
"category": "Virtual Machines",
"resource_name": "B2s",
"tags": [
"Veeam backup appliance ID: 2bkea35c-1243-abcd-9f12-ecc129f5f0d0",
"veeam01: dfgni2MJCI"
],
"billing_period": "2023-06",
"total": "0.150528"
}
]
}
}