Reports: API routes

Overview

This document describes the Serverside.ai API routes for accessing systems and reports.

API conventions for new endpoints

Specific conventions apply to new API endpoints. For more information, see API conventions for new endpoints. 

Systems: GET systems

GET https://mydomain.com/api/v2/systems

This API route lists all your systems. Each system has a unique ID, which is required when listing or querying reports.

Path parameters

Field Type Description
x-api-key string Your Serverside.ai API key.

200

[
   {
       "_id": "5d80ead4eb46fe2ea810a244",
       "name": "ams",
       "type": "azure-media-services",
       "settings": {
           "resourceGroup": "<RESOURCE GROUP>",
           "activeDirectoryClientSecret": "<A SECRET>",
           "storageAccount": "<ACCOUNT NAME>",
           "azureMediaServiceName": "<SERVICE NAME>",
           "activeDirectoryTenantId": "<UUID>",
           "storageKey": "<STORAGE KEY>",
           "activeDirectoryClientId": "<UUID>",
           "azureSubscriptionId": "<UUID>",
           "container": "<CONTAINER>"
       },
       "id": "<UUID>",
       "createdBy": "user@company.com",
       "createdAt": "2019-09-17T14:16:52.669Z",
       "tenant": "Another New Company",
       "__v": 0
   },
   {
       "_id": "<ID>",
       "name": "ssai",
       "type": "ssai",
       "settings": {
           "url": "https://mydomain.com/channel-api/api/v1/channels",
           "username": "<USERNAME>",
           "password": "<PASSWORD>",
           "elasticSearchDomain": "https://xxxxxxxxxxxxxxxxxxxxxxxxxxxx.eu-central-1.aws.cloud.es.io:9243",
           "elasticSearchUser": "<USER>",
           "elasticSearchPassword": "<PASSWORD>",
           "elasticSearchIndex": "<INDEX>"
       },
       "id": "<GUID>",
       "createdBy": "user@company.com",
       "createdAt": "2019-09-17T14:15:28.902Z",
       "tenant": "Another New Company",
       "__v": 0,
       "modifiedAt": "2019-09-25T09:18:52.382Z",
       "modifiedBy": "user@company.com"
   }
]
 
 

Reports: GET by system

GET  https://mydomain.com/api/v2/systems/:systemid/reports

This route lists all report names for a given system. Use the system’s unique ID (UUID) obtained from the Systems: GET systems route.

Path parameters

Field Type Description
:systemid string The ID (UUID) of the relevant system.

Headers

Field Type Description
x-api-key string Your Serverside.ai API key.

200

[
    "Incoming-Events",
    "Event-Count",
    "Ad-Campaign",
    "Audience-Share",
    "Viewing-Time",
    "Unique-Users",
    "Channel-Lineup",
    "Per-Region",
    "Viewer-Engagement",
    "Device-Types"
]
 
 

Reports: GET

GET https://mydomain.com/api/v2/systems/:systemid/reports/:report-name

Get the report name from the Reports: GET by system route.

Path parameters

Field Type Description
:systemid string The ID of the relevant system (UUID).
:report-name string The name of the report, for example, "Viewing-Time".

Query parameters

Field Type Description
start number The start datetime expressed as a UNIX timestamp.
end number The end datetime expressed as a UNIX timestamp.
interval number The sampling interval, expressed in milliseconds.

200

{
    "chartType": "Bar",
    "labels": [
        "'11.",
        "'12.",
        "'13.",
        "'14.",
        "'15.",
        "'16.",
        "'17.",
        "'18.",
        "'19.",
        "'20.",
        "'21.",
        "'22.",
        "'23.",
        "'24.",
        "'25."
    ],
    "series": [
        {
            "name": "Viewing Time Sum",
            "data": [
                58417.43,
                21547.801,
                36662.05,
                22057.06,
                8219.564999999999,
                20154.076,
                11223.451,
                58562.409,
                21852.694,
                21611.001,
                0,
                102.65899999999999,
                95233.44200000001,
                95105.662,
                15863.242
            ]
        }
    ],
    "category": "Viewer Engagement"
}