You can call the CreateUserUsageDataExportTask operation to create a task to export account-based usage details and generate a PDF file for downloading.

Note You can create a task that queries data of up to one year. The maximum time range that can be queried for an export task is one month.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Description
Action String  Yes The operation that you want to perform. Set this parameter to CreateUserUsageDataExportTask.
StartTime String Yes The beginning of the time range where the data is queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The minimum data sampling interval is 5 minutes.
EndTime String Yes The end of the time range where the data is queried. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
TaskName String No The name of the task to be created.
Type String Yes The type of usage data. Valid values: flow and vas.

Response parameters

Parameter Type Description
RequestId String The ID of the request.
StartTime String The beginning of the time range where the data was queried.
End time. String The end of the time range where the data was queried.
TaskId String The ID of the task.

Examples

Sample request

http://cdn.aliyuncs.com?Action=CreateUserUsageDataExportTask&Type=flow
&StartTime=2018-12-10T20:00:00Z
&EndTime=2018-12-10T21:00:00Z
&<Common request parameters>          

Sample success response

JSON format

{
  "RequestId": "ED61C6C3-8241-4187-AAA7-5157AE175CEC",
  "StartTime": "2018-12-10T20:00:00Z",
  "EndTime": "2018-12-10T21:00:00Z",
  "TaskId": "129456"
}

Error codes

Error code Description HTTP status code Description
Throttling Request was denied due to request throttling. 503 The error message returned because the request was denied due to throttling.
IllegalOperation Illegal domain, operation is not permitted. 403 The error message returned because the specified domain name is invalid.
OperationDenied Your account does not open Cdn service yet. 403 The error message returned because CDN has not been activated for your account.
OperationDenied Your Cdn service is suspended. 403 The error message returned because CDN has been suspended for your account.
InvalidParameter Invalid Parameter. 400 The parameters are invalid.
InvalidParameterProduct Invalid Parameter Product. 400 The error message returned because the specified Product parameter is invalid.
InvalidParameterAliuid Invalid Parameter Aliuid. 400 The error message returned because the specified Aliuid parameter is invalid.
InvalidParameterStartTime Invalid Parameter StartTime. 400 The error message returned because the specified StartTime parameter is invalid.
InvalidParameterEndTime Invalid Parameter EndTime. 400 The error message returned because the specified EndTime parameter is invalid.
InvalidTimeRange StartTime and EndTime range should less than 1 month. 400 The error message returned because the duration specified by the StartTime and EndTime parameters exceeds the maximum value of 31 days.
InvalidParameterOperator Invalid Parameter Operator. 400 The error message returned because the specified Operator parameter is invalid.