API Overview

This page describes the steps to access SmartSight Analytics API.

MediaMelon provides REST APIs that lets you read data from the SmartSight dashboard using APIs. You can use these APIs to fetch data and process it as per your need. The SmartSight APIs are protected using OAuth2.

Prerequisites

  1. Username - Your SmartSight username

  2. Password - Your SmartSight password

Contact your MediaMelon representative in case you're not aware of the above mentioned prerequisites

Fetch OAuth Token

Retrieve an OAuth token for authentication.

API Request

POST https://smartsight2.mediamelon.com/generateOAuthToken

Headers

NameTypeDescription

Content-Type*

String

application/x-www-form-urlencoded

Request Body

NameTypeDescription

grant_type*

String

password

username

String

<SmartSight Username>

password

String

<SmartSight Password>

{
“access_token”: “<your_access_token>”,
“expires_in”: 3600,
“refresh_token”: “<your_refresh_token”,
“token_type”: “bearer”,
“scope”: “read”
}

Sample Curl Request

curl --location 'https://smartsight2.mediamelon.com/generateOAuthToken' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username=<username>' \
--data-urlencode 'password=<password>'

Request Body ( For refresh_token based grant)

{
“grant_type”: “refresh_token”,
“username”: “<your_refresh_token>”
}

Endpoint to fetch metrics

Use the OAuth access token in the request header when accessing any of the SmartSight APIs.

API Request

GET https://smartsight2.mediamelon.com/mm-apis/qbrData/vod/{customer-id}

Path Parameters

NameTypeDescription

{customer-id}*

String

The unique identifier for the Video On Demand content

Query Parameters

NameTypeDescription

planlevel

String

The plan level ID. (e.g., 6831)

metrics*

String

Comma-separated list of metrics to retrieve. (e.g. playdur,bufferingratio,latency,subscriberid,errors,viewercount,subscribertag,ipaddress,timestamp,starttime,endtime)

orderas

String

Order in which results are returned. (e.g., DESC)

offset

String

Starting index for the returned data. (e.g., 1)

count

String

Number of records to retrieve. (e.g., 1)

limit*

String

Maximum number of records to return. (e.g., 10)

filter

String

Filter criteria (e.g., subscriberid={subscriber-id})

period*

String

Comma-separated Start date and end date (eg: start=1696357800,end=1696361400)

dimension*

String

The target level for data (eg: microscope)

agg*

String

Flag for enabling or disabling aggregation (values: 1 or 2)

aggby

String

If aggregation is enabled, please provide aggregation by (eg.: subscriberid)

orderby

String

Field to order data by. (eg.: viewercount)

{
    "totalcount": 9860,
    "pagecount": 10,
    "response": [values]
}

Sample Curl Request

curl --location 'https://smartsight2.mediamelon.com/mm-apis/qbrData/vod/<customer-id>?planlevel=6831&metrics=playdur%2Cbufferingratio%2Clatency%2Csubscriberid%2Cerrors%2Cviewercount%2Csubscribertag%2Cipaddress%2Ctimestamp%2Cstarttime%2Cendtime&dimension=microscope&agg=1&period=start%3D2696357800%2Cend%3D1696361400&aggby=subscriberid&orderby=viewercount&orderas=DESC&offset=1&count=1&limit=10' \
--header 'Authorization: Bearer <Token>

Last updated