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/ | Description |
---|---|---|---|---|
X-Api-Token | header | string | Required | API token of a manager that performs the operation (see Viewing and updating Manager's information) |
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 | ||||||
---|---|---|---|---|---|---|---|---|
subscription | object | Information about the subscription | ||||||
id | integer | The subscription ID | ||||||
items | array of objects | The list of resources and expenses | ||||||
billed_day | string | The date when consumption was billed in the platform (YYYY-MM-DD) | ||||||
total | string | The 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"
}
]
}
}