Generate Downloadable Report

Generates report data that can be downloaded as a compressed comma-separated value (CSV) or JSON file from AWS S3.

Key information:

Request

Generate a report via the following request:

HTTP Method Request URI

POST

https://api.vdms.io/report-builder/v1/downloadable-reports

Request Headers

This endpointIdentifies a request's connection point to our REST API service. only takes advantage of common request headers.

Unlike requests to api.edgecast.com, requests to our API gateway (api.vdms.io) require an access token (OAuth).

Request Body

Pass the following request body parameters:

Name Data Type Description

query

Required

Object

Determines how report data will be generated.

filename

String

Determines the file name that will be passed in the Content-Disposition header when report data is requested.

Certain user agents (e.g., browsers) use the Content-Disposition header when assigning a file name to downloaded content.

Default Value:

format

String

Determines the format in which report data will be generated. Valid values are:

csv | json

Default Value:

csv

query Object

The query object contains the following property:

Name Data Type Description

params

Object

Contains a configuration for report data generation.

params Object

The params object contains the following properties:

Name Data Type Description

by

String

Identifies a granularity by its system-defined ID.

Use the Get All Granularities endpoint to retrieve a list of available granularities and their system-defined IDs.

Due to our data retention policy, the set of available granularities varies according to the age of the data being requested. Pass the start and end query string parameters when requesting the Get All Granularities endpoint to find out the set of supported granularities for that time range.

dimensions

Object

Contains a string value for each dimension that will be included in the report.

Use the Get All Dimensions endpoint to retrieve a list of dimensions and their system-defined IDs.

end

Required

String

Required for the params Object

Determines the report's relative or fixed end date/time.

Time is only relevant for reports that only contain data that occurred within the last 7 days and whose time interval is set to 5 minutes or hourly.

Fixed Date Syntax:

YYYY-MM-DDThh:mm:ss:ffffffZ

Learn more.

filter

String

Contains a list of filters for the data that will be generated for this report.

Key information:

  • Set this property by converting an array of objects into a string value. Each object in this array represents a filter. Each object contains the following properties:

    • field: A string that identifies a dimension by its system-defined ID. Report data will be filtered by this dimension.

      Use the Get All Dimensions endpoint to retrieve a list of dimensions and their system-defined IDs.

    • operator: A string that identifies a comparison operator by its system-defined ID. This comparison operator establishes the relationship between field and value that report data must meet.

      Use the Get All Operators endpoint to retrieve a list of comparison operators and their system-defined IDs.

    • value: A string, number, or array that indicates the value to which the comparison operator will be applied. The data type for this property is determined by the comparison operator's multi_value property and the dimension's field_type property.
  • Example:

    The following configuration filters by delivery platform:

    Property Value

    field

    String

    platform

    operator

    String

    in

    value

    Array of String Values

    Valid values are:

    • cache: HTTP Large
    • wac: HTTP Small
    • adn:ADN

    The following code excerpt filters by the ADN delivery platform:

    "filter": "[{\"field\":\"platform\",\"operator\":\"in\",\"value\":[\"adn\"]}]",	

limit

Integer

Determines the maximum number of rows that may be included in a report. A valid value is any positive integer.

metrics

Required

Array of String Values

Required for the params Object

Identifies one or more metrics that will be included in the report. Specify each metric as a string value.

Use the Get All Metrics endpoint to retrieve a list of metrics and their system-defined IDs.

sort

Array of String Values

Determines how report data will be sorted.

Key information:

  • Sort report data by dimensions or metrics.
  • Perform a reverse sort by prepending -.

    Example:

    Sort report data by number of requests in descending order.

    ["-request_count"]
  • The first string value in the array determines how records will be sorted. Additional string values determine sort order for records with the same value.

start

Required

String

Required for the params Object

Determines the report's relative or fixed start date/time.

Fixed Date Format:

YYYY-MM-DDThh:mm:ss:ffffffZ

Learn more.

units

Object

Indicates unit information for each metric defined by the metrics property. This information is reported as a key-value pair with the following syntax:

"Metric" : "Unit ID"

Do not provide unit information for metrics that report percentages.

Default Value:

If a unit of measurement is not assigned to a metric, then it will be assigned one that has a matching type and whose scale property is set to 1. Use the Get All Units endpoint to view the type and scale for each unit of measurement.

Response

The response to the above request includes an HTTP status code, response headers, and a response body.

Status Code

A status code indicates whether the request was successfully performed.

Response Headers

The response for this endpoint only includes standard HTTP response headers.

View common response headers.

Response Body

The response body for a successful request contains the following response elements:

Name Data Type Description
@id String Indicates the relative path to an endpoint through which you may retrieve the current report.

@type

String

Returns Report.

completed_at

String

Indicates the timestamp (UTC) at which report data generation completed.

Syntax:

YYYY-MM-DDThh:mm:ss:ffffffZ

Learn more.

created_at

String

Indicates the timestamp (UTC) at which report data was requested.

Syntax:

YYYY-MM-DDThh:mm:ss:ffffffZ

Learn more.

dimensions

Array of String Values

Indicates the report's actual dimensions.

Time is automatically reported when a time interval has been defined. If the report's configuration defines the by property, then the time dimension, if not already present, will be added to this property's value. If this occurs, then this property will not match the dimensions property in the query object.

expires_at

String

Indicates the timestamp (UTC) at which the signed URL defined by the link property will expire.

Syntax:

YYYY-MM-DDThh:mm:ss:ffffffZ

Learn more.

id

String

Identifies this report by its system-defined ID.

link

String

Indicates a signed URL through which you may download report data.

This signed URL expires after 5 minutes. Check the expiration date via the expires_at property.

Compressed File Syntax:

https://s3-us-west-2.amazonaws.com/cdna-rtap-reports2/Report IDRepresents the system-defined ID assigned to the report..FormatRepresents either csv or json..zip?response-content-disposition=attachment%3B%20filename%3D%22Report ID.zip%22&Signature=Token%3D&Expires=Unix Time&AWSAccessKeyId=Key ID

The file name defined in the query string determines the file name that will be passed by the Content-Disposition header. By default, it is set to the report ID. Override it when generating report data by passing the filename request body property.

File Name Syntax:

metrics

Array of String Values

Indicates the report's metrics.

query

Object

Contains the query used to generate report data.

status

String

Indicates the current status for the request to generate report data. Valid values are:

submitted | processing | error | canceled | completed

query Object

The query object describes the query used to generate report data via the following properties:

Name Data Type Description

params

Object

Defines the query for the data generated in the current report.

params Object

The params object contains the following properties:

Name Data Type Description

by

String

Identifies a granularity by its system-defined ID.

Use the Get All Granularities endpoint to retrieve a list of available granularities and their system-defined IDs.

dimensions

Object

Contains a string value for each dimension assigned to this report.

Use the Get All Dimensions endpoint to retrieve a list of dimensions and their system-defined IDs.

end

String

Indicates the report's fixed end date/time.

Upon generating a downloadable report, relative dates are converted to fixed dates.

Syntax:

YYYY-MM-DDThh:mm:ss:ffffffZ

Learn more.

filter

String

Contains a list of filters.

Key information:

  • This property is an array of objects expressed as a string value. Each object in this array represents a filter. Each object contains the following properties:

    • field: A string that identifies a dimension by its system-defined ID. Report data will be filtered by this dimension.

      Use the Get All Dimensions endpoint to retrieve a list of dimensions and their system-defined IDs.

    • operator: A string that identifies a comparison operator by its system-defined ID. This comparison operator establishes the relationship between field and value that report data must meet.

      Use the Get All Operators endpoint to retrieve a list of comparison operators and their system-defined IDs.

    • value: A string, number, or array that indicates the value to which the comparison operator will be applied. The data type for this property is determined by the comparison operator's multi_value property and the dimension's field_type property.
  • Example:

    The following configuration filters by delivery platform:

    Property Value

    field

    String

    platform

    operator

    String

    in

    value

    Array of String Values

    Valid values are:

    • cache: HTTP Large
    • wac: HTTP Small
    • adn: ADN

    The following code excerpt filters by the ADN delivery platform:

    "filter": "[{\"field\":\"platform\",\"operator\":\"in\",\"value\":[\"adn\"]}]",	

limit

Integer

Determines the maximum number of rows that may be included in a report. A valid value is any positive integer.

metrics

Array of String Values

Identifies one or more metrics that will be included when report data is generated from this report.

Use the Get All Metrics endpoint to retrieve a list of metrics and their system-defined IDs.

sort

Array of String Values

Determines how report data will be sorted.

Key information:

  • Sort report data by dimensions or metrics.
  • Perform a reverse sort by prepending -.

    Example:

    Sort report data by number of requests in descending order.

    ["-request_count"]
  • The first string value in the array determines how records will be sorted. Additional string values determine sort order for records with the same value.

end

String

Indicates the report's fixed start date/time.

Upon generating a downloadable report, relative dates are converted to fixed dates.

Syntax:

YYYY-MM-DDThh:mm:ss:ffffffZ

Learn more.

units

Object

Indicates unit information for each metric defined in the report. This information is reported as a key-value pair with the following syntax:

"Metric" : "Units"

Use the Get All Units endpoint to retrieve a list of units of measurements and their system-defined IDs.

Unit information is not provided for metrics that report percentages.

Errors

The response body for an unsuccessful request will contain an error response that provides additional information.

Sample Request and Response

A sample JSON request is shown below.

{
	"query": {
		"params": {
			"by": null,
			"end": "now",
			"metrics": [
				"file_size"
			],
			"sort": [
				"-file_size"
			],
			"start": "start_day-7d",
			"units": {
				"file_size": "megabyte"
			}
		}
	}
}

A sample JSON response for a completed report is shown below.

HTTP/1.1 200 OK

Cache-Control: no-cache

Content-Type: application/json; charset=utf-8

Date: Thu, 15 Apr 2021 12:00:00 GMT

Content-Length: 882

{
	"@id": "/report-builder/v1/downloadable-reports/24586183a2a10b7a645fcd69",
	"@type": "DownloadableReport",
	"completed_at": "2020-02-28T00:40:36.479000Z",
	"created_at": "2020-02-28T00:40:35.741000Z",
	"dimensions": [],
	"expires_at": "2020-02-28T00:45:38Z",
	"id": "24586183a2a10b7a645fcd69",
	"link": "https://cdna-rtap-reports2.s3.amazonaws.com/24586183a2a10b7a645fcd69.csv.zip?resp...https://cdna-rtap-reports2.s3.amazonaws.com/24586183a2a10b7a645fcd69.csv.zip?response-content-disposition=attachment%3B%20filename%3D%2224586183a2a10b7a645fcd69.zip%22&Expires=1582850738&Signature=I52VF4bZmFxg4a0rt0chBIfDGzU%3D&AWSAccessKeyId=AKIAZJIESJWHBI7NDUVF",
	"metrics": [
		"file_size"
	],
	"query": {
		"params": {
			"end": "2020-02-28T00:40:35Z",
			"metrics": [
				"file_size"
			],
			"sort": [
				"-file_size"
			],
			"start": "2020-02-21T00:00:00Z",
			"units": {
				"file_size": "megabyte"
			}
		}
	},
	"status": "completed"
}

A sample JSON response for a report that is still being processed is shown below.

HTTP/1.1 202 Accepted

Cache-Control: no-cache

Content-Type: application/json; charset=utf-8

Date: Thu, 15 Apr 2021 12:00:00 GMT

Content-Length: 516

{
	"@id": "/report-builder/v1/downloadable-reports/24586183a2a10b7a645fcd69",
	"@type": "DownloadableReport",
	"created_at": "2020-02-28T00:40:35.741000Z",
	"dimensions": [],
	"id": "24586183a2a10b7a645fcd69",
	"metrics": [
		"file_size"
	],
	"query": {
		"params": {
			"end": "2020-02-28T00:40:35Z",
			"metrics": [
				"file_size"
			],
			"sort": [
				"-file_size"
			],
			"start": "2020-02-21T00:00:00Z",
			"units": {
				"file_size": "megabyte"
			}
		}
	},
	"status": "submitted"
}