Get All Granularities

Retrieves all available granularities. Granularity defines the time interval for the data contained within each record in the report.

Request

Retrieve granularities via the following request:

HTTP Method Request URI

GET

https://api.vdms.io/report-builder/v1/granularities?start=StartDateTime&end=EndDateTime

Omit the query string to retrieve all granularities.

Due to data retention policies, the set of available granularities varies according to the age of the data being requested. Use the start and end query string parameters to find out the set of available granularities for a specific time range. Set those parameters by defining the following variables:

VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3). Description

StartDateTime

Replace this variable with a fixed or relative start date/time.

Fixed Date/Time Syntax:

YYYY-MM-DDThh:mm:ss:ffffffZ

EndDateTime

Replace this variable with a fixed or relative end date/time.

Fixed Date/Time Syntax:

YYYY-MM-DDThh:mm:ss:ffffffZ

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

Request body parameters are not required by this endpoint.

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 the requested endpoint.

@type

String

Returns Collection.

items

Array

Contains a list of granularities

items Array

The items array describes each granularity via the following properties:

Name Data Type Description

@id

String

Indicates the relative path to an endpoint through which you may retrieve the current granularity.

@type

String

Returns Granularity.

description

String

Describes the purpose of the current granularity.

duration_seconds

Integer

This property is reserved for future use.

id

String

Identifies the granularity by its system-defined ID.

name

String

Identifies the granularity by its friendly name.

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.

A sample JSON response 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: 1118

{
	"@id": "/report-builder/v1/granularities",
	"@type": "Collection",
	"items": [{
			"@id": "/report-builder/v1/granularities/5minute",
			"@type": "Granularity",
			"description": "Aggregate every 5 minute",
			"duration_seconds": 300,
			"id": "5minute",
			"name": "Five Minutes"
		}, {
			"@id": "/report-builder/v1/granularities/hour",
			"@type": "Granularity",
			"description": "Aggregate every 1 hour",
			"duration_seconds": 3600,
			"id": "hour",
			"name": "Hourly"
		}, {
			"@id": "/report-builder/v1/granularities/day",
			"@type": "Granularity",
			"description": "Aggregate every 1 day",
			"duration_seconds": 86400,
			"id": "day",
			"name": "Daily"
		}, {
			"@id": "/report-builder/v1/granularities/week",
			"@type": "Granularity",
			"description": "Aggregate every 1 week",
			"duration_seconds": 604800,
			"id": "week",
			"name": "Weekly"
		}, {
			"@id": "/report-builder/v1/granularities/month",
			"@type": "Granularity",
			"description": "Aggregate every 1 month",
			"duration_seconds": 2592000,
			"id": "month",
			"name": "Monthly"
		}
	]
}