Generate Report

Generate report data.

Key information:

Request

Generate a report via the following request:

HTTP Method Request URI

POST

https://api.vdms.io/report-builder/v1/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

Defines how report data will be generated.

delivery

Object

Determines whether report data will be delivered via email or included in the response.

  • Email: If you include this optional parameter, then our service will deliver report data via email upon successfully generating your report. The response to a successful request will be a 202 Accepted.
  • Response Body: If you do not specify this optional parameter, then our service will provide report data within the items array of the response for this endpoint when the status response property returns completed.

    Use the Get Report endpoint to find out a report's status and to retrieve report data.

query Object

The query object contains the following property:

Name Data Type Description

params

Object

Contains a configuration for report data generation and delivery.

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

Required

Integer

Required for the params Object

Determines the maximum number of rows that may be included in a report. Valid values are:

1 - 30000

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"]
  • If a second metric or dimension is defined, then report data will be sorted by the first field. The second field determines how records with the same value will be sorted.

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" : "Units"

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.

delivery Object

The delivery object contains the following properties:

Name Data Type Description

format

String

Determines whether report data will be formatted as CSV or JSON. Valid values are:

csv | json

method

String

Set it to email.

properties

Object

Contains settings that define email delivery.

body

String

Contains the body of the email.

filename

String

Defines the report's base file name. The report's start and end date/time is appended to this name.

Syntax:

Date/Time Syntax:

YYYY-MM-DDThh:mm:ss:ffffffZ

Learn more.

subject

String

Contains the email's base subject line. The report's start and end date/time is appended to this subject line.

Syntax:

Date/Time Syntax:

YYYY-MM-DDThh:mm:ss:ffffffZ

Learn more.

to

String

Identifies one or more recipients by their email address. Use a comma to delimit multiple email addresses. Each specified email address must correspond to a user within your MCC account.

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 query'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.

id

String

Identifies this report by its system-defined ID.

items

Array of Objects

Contains report data. Each object, which represents a recordA record contains report data that identifies each unique combination of dimensions. in the report, contains key-value pairs that correspond to the set of fields reported by the metrics and dimensions properties.

Report data is only returned when the status property is set to completed.

A record will only be included within a report when at least one metric is set to a non-zero value. Missing records is not an indicator of data loss.

If a time interval has been defined via the by property, then the Time dimension will be automatically included in the report. This occurs regardless of whether it was defined in the report query.

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

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.

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. Valid values are:

1 - 30000

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.

start

String

Determines the report's relative or fixed start 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 Format:

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",
			"limit": 5000,
			"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: 577

{
	"@id": "/report-builder/v1/reports/24571caae75e2a69f2f4bf8a",
	"@type": "Report",
	"completed_at": "2020-02-27T01:34:36.392000Z",
	"created_at": "2020-02-27T01:34:34.655000Z",
	"dimensions": [],
	"id": "24571caae75e2a69f2f4bf8a",
	"items": [{
			"file_size": 57.15
		}
	],
	"metrics": ["file_size"],
	"query": {
		"params": {
			"end": "2020-02-27T01:34:34Z",
			"limit": 5000,
			"metrics": ["file_size"],
			"sort": ["-file_size"],
			"start": "2020-02-20T00:00:00Z",
			"units": {
				"file_size": "terabyte"
			}
		}
	},
	"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: 496

{
	"@id": "/report-builder/v1/reports/24571caae75e2a69f2f4bf8a",
	"@type": "Report",
	"created_at": "2020-02-27T01:34:34.655000Z",
	"dimensions": [],
	"id": "24571caae75e2a69f2f4bf8a",
	"items": [],
	"metrics": ["file_size"],
	"query": {
		"params": {
			"end": "2020-02-27T01:34:34Z",
			"limit": 5000,
			"metrics": ["file_size"],
			"sort": ["-file_size"],
			"start": "2020-02-20T00:00:00Z",
			"units": {
				"file_size": "terabyte"
			}
		}
	},
	"status": "submitted"
}