Get daily analytics

The Get daily analytics method is used to get information about daily expenses for a pay-as-you-go 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_daily

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

subscriptionobjectInformation about the subscription

idintegerThe subscription ID

export_headersarrayThe header names for a consumption report


keystringThe header key


typestringData type

itemsarrayThe list of resources and expenses 


billed_daystringThe date when consumption was billed in the platform (YYYY-MM-DD)


descriptionstringThe consumption description


tagsarrayThe list of the resource tags


operate_daystringThe consumption date (YYYY-MM-DD)


unit_pricestringThe unit price of the consumed resource


durationstringThe quantity of the consumed resource units


discount_amountstringThe discount amount


totalstringThe consumption costs


taxes_totalstringThe tax amount


categorystringThe resource category


resource_namestringThe resource name


resource_groupstringThe resource group


currencystringThe currency code


unitstringThe resource unit


Other attributes — depending on the service

Request example

GET /api/v3/analytics_daily?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

{
  "subscription": {
    "id": "53840",
    "export_headers": [
      {
        "key": "sku",
        "type": "string"
      },
      {
        "key": "category",
        "type": "string"
      },
      {
        "key": "subcategory",
        "type": "string"
      },
      {
        "key": "resource_name",
        "type": "string"
      },
      {
        "key": "description",
        "type": "string"
      },
      {
        "key": "currency",
        "type": "string"
      },
      {
        "key": "region",
        "type": "string"
      },
      {
        "key": "unit",
        "type": "string"
      },
      {
        "key": "resource_group",
        "type": "string"
      },
      {
        "key": "virtual_machine_name",
        "type": "string"
      },
      {
        "key": "duration",
        "type": "number"
      },
      {
        "key": "unit_price",
        "type": "number"
      },
      {
        "key": "discount_amount",
        "type": "number"
      },
      {
        "key": "taxes_total",
        "type": "number"
      },
      {
        "key": "total",
        "type": "number"
      },
      {
        "key": "operate_day",
        "type": "date"
      },
      {
        "key": "billed_day",
        "type": "date"
      }
    ],
    "items": [
      {
        "billed_day": "2023-06-30",
        "description": "Azure App Service: S1 App",
        "tags": [],
        "operate_day": "2023-06-30",
        "unit_price": "0.13664",
        "duration": "1.0",
        "discount_amount": "0.0",
        "total": "0.13664",
        "taxes_total": "0.0",
        "category": "Azure App Service",
        "subcategory": "Azure App Service Standard Plan",
        "sku": "011d5795-7609-4c28-8084-cd26374a1d0e",
        "resource_name": "S1 App",
        "resource_group": "rgportalprd",
        "currency": "USD",
        "region": "BR South",
        "unit": "1 Hour"
      },
      {
        "billed_day": "2023-06-30",
        "description": "Storage: P4 LRS Disk",
        "tags": [],
        "operate_day": "2023-06-30",
        "unit_price": "10.215072",
        "duration": "0.001389",
        "discount_amount": "0.0",
        "total": "0.014189",
        "taxes_total": "0.0",
        "category": "Storage",
        "subcategory": "Premium SSD Managed Disks",
        "sku": "fec1d8d1-cc81-4d54-a391-83e228df4928",
        "resource_name": "P4 LRS Disk",
        "resource_group": "rgLan",
        "currency": "USD",
        "region": "BR South",
        "unit": "1/Month"
      },
      {
        "billed_day": "2023-06-30",
        "description": "Virtual Machines: B4ms",
        "tags": [],
        "operate_day": "2023-06-30",
        "unit_price": "0.30128",
        "duration": "2.0",
        "discount_amount": "0.0",
        "total": "0.60256",
        "taxes_total": "0.0",
        "category": "Virtual Machines",
        "subcategory": "Virtual Machines BS Series",
        "sku": "f99c993a-da76-4b9b-824a-bd041aff7005",
        "resource_name": "B4ms",
        "resource_group": "RGLAN",
        "currency": "USD",
        "region": "BR South",
        "unit": "1 Hour"
      },
      {
        "billed_day": "2023-06-30",
        "description": "Storage: LRS List and Create Container Operations",
        "tags": [],
        "operate_day": "2023-06-30",
        "unit_price": "0.000403",
        "duration": "0.0005",
        "discount_amount": "0.0",
        "total": "0.0",
        "taxes_total": "0.0",
        "category": "Storage",
        "subcategory": "General Block Blob",
        "sku": "f8c187bb-5a47-46ae-b874-f186d207fff4",
        "resource_name": "LRS List and Create Container Operations",
        "resource_group": "rgLan",
        "currency": "USD",
        "region": "",
        "unit": "10K"
      },
      {
        "billed_day": "2023-06-30",
        "description": "VPN Gateway: Standard Gateway",
        "tags": [],
        "operate_day": "2023-06-30",
        "unit_price": "0.2128",
        "duration": "0.838333",
        "discount_amount": "0.0",
        "total": "0.178397",
        "taxes_total": "0.0",
        "category": "VPN Gateway",
        "subcategory": "VPN Standard Gateway",
        "sku": "f246df93-e03d-4e52-ae97-a43e8f3d542c",
        "resource_name": "Standard Gateway",
        "resource_group": "rgLan",
        "currency": "USD",
        "region": "",
        "unit": "1 Hour"
      },
      {
        "billed_day": "2023-06-30",
        "description": "Virtual Network: Basic IPv4 Dynamic Public IP",
        "tags": [],
        "operate_day": "2023-06-30",
        "unit_price": "0.00448",
        "duration": "1.561666",
        "discount_amount": "0.0",
        "total": "0.006996",
        "taxes_total": "0.0",
        "category": "Virtual Network",
        "subcategory": "IP Addresses",
        "sku": "f114cb19-ea64-40b5-bcd7-aee474b62853",
        "resource_name": "Basic IPv4 Dynamic Public IP",
        "resource_group": "rgLan",
        "currency": "USD",
        "region": "",
        "unit": "1 Hour"
      },
      {
        "billed_day": "2023-06-30",
        "description": "Virtual Machines: D2/DS2",
        "tags": [],
        "operate_day": "2023-06-30",
        "unit_price": "0.35392",
        "duration": "2.0",
        "discount_amount": "0.0",
        "total": "0.70784",
        "taxes_total": "0.0",
        "category": "Virtual Machines",
        "subcategory": "Virtual Machines D Series Windows",
        "sku": "f084eedf-a23f-46d2-bc24-b913ab919c95",
        "resource_name": "D2/DS2",
        "resource_group": "RGLAN",
        "currency": "USD",
        "region": "BR South",
        "unit": "1 Hour"
      },
      {
        "billed_day": "2023-06-30",
        "description": "Bandwidth: Standard Data Transfer In",
        "tags": [],
        "operate_day": "2023-06-30",
        "unit_price": "0.0",
        "duration": "0.00461",
        "discount_amount": "0.0",
        "total": "0.0",
        "taxes_total": "0.0",
        "category": "Bandwidth",
        "subcategory": "Rtn Preference: MGN",
        "sku": "e315c24e-2f54-4668-95ae-5aef18f93125",
        "resource_name": "Standard Data Transfer In",
        "resource_group": "rgLan",
        "currency": "USD",
        "region": "BR South",
        "unit": "1 GB"
      }
    ]
  }
}