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

Request Body

{
“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

Query Parameters

{
    "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