Media Reports API Data

This section provides details for each type of data object the API exchanges.

Schemas

Report

Encapsulates a media services data report for various delivery types.

Sample GET:

{
    "columns": [
        {
            "type": "dimension",
            "name": "Time",
            "description": "Indicates the time at which content was consumed. This dimension is set automatically.",
            "index": 0
        },
        {
            "type": "metric",
            "name": "Hits",
            "description": "Hits",
            "index": 1,
            "aggregate": "46055"
        }
    ],
    "rows": [
        [ "1471737600", "158" ],
        [ "1471737720", "138" ],
        [ "1471737840", "183" ],
        [ "1471737960", "158" ],
        [ "1471738080", "163" ],
        [ "1471738200", "155" ]
    ],
    "metaData": {
        "startTimeInEpoch": 1471737600,
        "offset": 0,
        "limit": 300,
        "timeZone": "GMT",
        "hasMoreData": true,
        "aggregation": 120,
        "endTimeInEpoch": 1471860000
    }
}

Report Members

Member Type Required Description
columns Report.columns[n] Provides context for each element listed within corresponding rows.
metaData Report.metaData Reflects parameter values included in the request that determines this report’s results.
rows Array Encapsulates the report’s two-dimensional table data. Empty rows are displayed if there is no data to report.

Report.columns[n]  

Provides context for each element listed within corresponding rows.

Member Type Required Description
aggregate String Provides the aggregate value for the dimension or metric, expressed in string format. For example, if type is metric and name is Hits, this would provide the number of hits for each row of data.
description String Provides information about the relevant dimension or metric.
index Number Positions each column within the table.
name String Depending on the type, provides the name of the relevant dimension or metric.
type Enumeration Type of data, either dimension or metric.

Report.metaData  

Reflects parameter values included in the request that determines this report’s results.

Member Type Required Description
aggregation Number The time span included in each record, expressed in seconds.
endTimeInEpoch Number The end of the requested time range, in epoch seconds.
hasMoreData Boolean Whether a constrained set of requested data does not represent the entire set.
limit Number The maximum number of requested data rows.
offset Number The offset of the row from which the data should start. Used with the overall limit, it reflects where a batch of data starts. For example, setting both offset and limit to 100 selects rows 101–200 from the overall results.
startTimeInEpoch Number The start of the requested time range, in epoch seconds.
timeZone String Identifies the time zone from which the request was made.

Report.rows   []

Member Type Required Description
rows String TBD: Need a description for Report.rows[n][n] string member.

FilterParams

Encapsulates filtering parameters, which are wrapped in an array, URL-encoded, and passed in with GET requests using the filterParams query parameter.

Sample non-encoded parameter value, expanded:

[
    {
        "condition": "in",
        "id": 4,
        "type": "dimension",
        "values": [ "GB" ]
    },
    {
        "condition": "gt",
        "id": 155,
        "type": "metric",
        "values": [ 16 ]
    }
]

FilterParams Members

Member Type Required Description
condition Enumeration The condition specifier. For dimensions: in, nin (in or not in), contains, ncontains (does or doesn’t contain), starts, nstarts (does or doesn’t start with), ends, nends (does or doesn’t end with). For metrics: eq, neq (equal or not), gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal).
id Integer The ID of the filtering entity (dimension/metric).
type Enumeration Specifies whether the parameter ID provided is a dimension or a metric.
values Array List of values used to filter the result. Multiple values are treated as inclusions. For exclusions use another filter object with appropriate values.

SortParams

Encapsulates sorting parameters, which are wrapped in an array, URL-encoded, and passed in with GET requests using the sortParams query parameter.

Sample non-encoded parameter value, expanded:

[
    {
        "id": 40,
        "order": "asc",
        "type": "metric"
    }
]

SortParams Members

Member Type Required Description
id Integer The ID of the sorting entity. It should also be part of the query parameter metrics or dimensions.
order Enumeration Either asc for ascending or desc for descending sort order.
type Enumeration Specifies whether the parameter ID provided is a dimension or a metric.

Last modified: 10/4/2017