Get daily drafts

The Get daily drafts method is used to get information about draft 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 without a breakdown by resource category and resource.

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_drafts

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

itemsarray of objectsThe list of resources and expenses 


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


totalstringThe consumption costs in the reseller currency

Request example

GET /api/v3/analytics_daily_drafts?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",
    "items": [
      {
        "billed_day": "2023-07-04",
        "total": "139.240562"
      },
      {
        "billed_day": "2023-07-05",
        "total": "139.248279"
      }
    ]
  }
}