Get monthly analytics

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.

An API token of a manager is required for authorization. To get an API token via the Operator Control Panel, see Viewing and updating manager's information

The manager's API token specified in an API request determines:

  • The role and access level of the manager, which determine the availability of a method.
  • The current reseller and downstream resellers accessible within a method.

GET {base_url}/api/v3/analytics_monthly

Arguments

Name

Parameter Type

Data type

Required/ 
Optional

Description

X-Api-TokenheaderstringRequiredAPI token of a manager that performs the operation (see Viewing and updating manager's information)
Content-TypeheaderstringRequiredMedia type of the request. Specify the following: application/vnd.api+json
AcceptheaderstringRequiredSupported media types of the answer. Specify the following: application/vnd.api+json
base_urlpathstringRequiredActivePlatform URL
subscription_idquerystringRequiredThe subscription ID
period_fromquerystringOptionalThe first billing period (YYYY-MM)
period_toquerystringOptionalThe last billing period (YYYY-MM)
date_fromquerystringRequiredThe first day of the target period (YYYY-MM-DD)
date_toquerystringRequiredThe last day of the target period (YYYY-MM-DD)

Response model

Name

Data type

Description

billing_periodsarrayThe list of billing periods (YYYY-MM)
subscriptionobjectInformation about the subscription

idintegerThe subscription ID

itemsarrayThe list of resources and expenses 


resource_groupstringThe resource name group


categorystringThe resource category


resource_namestringThe resource name


tagsarrayThe list of resource tags


billing_periodstringThe billing period (YYYY-MM)


totalstringThe 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
X-Api-Token: vY5fwetestK3gJXZH5uHCw
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"
            }
        ]
    }
}