MediaMelon
  • MediaMelon SDK Integration
  • MediaMelon SDK Events
  • MediaMelon Player SDK Integration
    • React Native
      • React Native Video v5.2.0 with Mediamelon SDK
      • React Native Video v6.4.2 with Mediamelon SDK
    • Web SDK
      • VideoJS Web with Mediamelon Analytics
      • VideoJS Web with Google DAI
      • Shaka Player Web v4
      • MediaMelon Web Kaltura Player Plugin Integration Document
      • NexPlayer Web v4
      • THEOPlayer Web
      • JWPlayer Web
      • Radiant Player Web
      • ChromeCast Player
      • HLSJS Player Web
      • HbbTV SDK
      • Comcast PDK 6
      • Bitmovin Web Player
      • HTML5 Player Web
      • Flow Player Web
      • DashJS Player Web
      • Castlabs Player Web
      • Cordova Plugin Toast (Smart TV)
      • Custom Player Web SDK
      • Plyr Player Web with MediaMelon Analytics
      • React Player SDK with IMA
    • Android SDK
      • App Analytics SDK
      • Bitmovin Android v3.73 with Content Provider Metrics
      • Exoplayer v2.13.2 integration with MediaMelon SDK
      • Exoplayer v2.17.1 with Mediamelon SDK
      • Exoplayer v2.12.2 integration with MediaMelon SDK
      • EXOPlayer-Android(V2.14.2) MediaMelon SDK with Google IMA DAI
      • EXOPlayer-Android(V2.17.1) MediaMelon SDK with Google IMA DAI
      • Exoplayer v2.11
      • Exoplayer v2.18.1 with Mediamelon SDK
      • Theoplayer v6.0.0 with Mediamelon SDK
      • Theoplayer v4.12.6 with Mediamelon SDK
      • Theoplayer v7.5.0 with Mediamelon SDK
      • Exoplayer v2.13.3 integration with MediaMelon SDK
      • Kaltura Android Player Integration with Mediamelon SDK
      • Media3 v1.3.0 and ExoPlayer 2.19.1 with MediaMelon SDK
      • Media3 v1.3.1 with MediaMelon SDK
      • MediaMelon Android Media3 v1.1.1 SDK Integration Document
      • Media3Player-Android(V1.3.0) MediaMelon SDK with Google IMA
    • Roku SDK
      • Roku SDK
      • Roku with RAF SDK
      • Roku with IMA SDK
    • iOS SDK
      • AVPlayer (Cocoapods)
      • AVPlayer with Google DAI SDK ( Framework )
      • AVPlayer Quality Of Experience SDK
      • AVPlayer Generic Framework
      • AVPlayer with Google DAI (Cocoapods)
      • Bitmovin iOS v3.44 with Content Provider Metrics
      • THEOPlayer XCFramework
      • THEOplayer (Cocoapods)
      • MediaMelon iOS Kaltura Player Plugin Integration Document
    • tvOS SDK
      • AVPlayer tvOS XCFramework
      • THEOPlayer tvOS XCFramework
    • Toast SDK
    • Custom Player C++ SDK
    • C++ SDK QoE Ads
    • Ad Integrations
      • Google IMA
      • FreeWheel
      • ServerSide.AI
  • SmartSight Analytics
    • Product Features
    • QBR Streaming
  • SmartSight API's
    • API Overview
      • Metric and Dimensions Dictionary
      • General Guidelines
      • Video Experience
      • Ad Experience
      • Smartquery Insights
      • Errors
      • Alerts
    • Use-case dictionary
Powered by GitBook
On this page
  • Prerequisites
  • Fetch Auth Token POST
  • SmartSight Metrics and Dimensions API
  • Endpoint :
  • SmartSight Smartquery API
  • Endpoint :
  • SmartSight Error API
  • Endpoint :
  • SmartSight Alert API
  • Endpoint :

Was this helpful?

  1. SmartSight API's

API Overview

Welcome to MediaMelon's SmartSight Analytics API developer documentation. This guide outlines how to access the these APIs and use them to access real-time and historical data.

The MediaMelon SmartSight Analytics APIs provide programmatic access to all the data which is currently visualized in the Smartsight web portal. You can use these RESTful API endpoints to build custom dashboards, extract data for warehouse purposes, or ingest data into third-party tools. MediaMelon APIs can be easily integrated into your applications and provide HTTP response codes to indicate API errors. The APIs are secured via OAuth2 authentication.

There are 4 sets of MediaMelon APIs as mentioned down here :

  1. SmartSight Metrics and Dimensions APIs

    • Metrics

    • Dimensions

  2. SmartSight Smartquery APIs

    • Content Paths

    • Subscriber Insight

  3. SmartSight Error APIs

    • Error Heatmap

  4. SmartSight Alert APIs

    • Alerts

Prerequisites

To fetch data from the backend, Smarthsight Analytics API authenticates users via an OAuth Token. To obtain this token, you need these 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 Auth Token POST

Updated SmartSight token for authentication based off Keycloak integration.

curl 'https://identity.mediamelon.com/realms/mediamelon/protocol/openid-connect/token'\
-x POST
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'username=<email-ID>' \
--data-urlencode 'password=<password>' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'client_id=smartsight-backend' \
--data-urlencode 'scope=openid'

Required request body parameters

Response

POST 201
{
    "access_token": "eyW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgZW1haWwgcHJvZmlsZSIsImVt0eXAiOiJCZWFyZXIiLCJhenAiOiJzbWFydHNpZ2h0LWJhY2tlbmQiLCJzaWQiOiI5NjdjMDJlNS1hOTYyLTRmY2QtYTEyNC1lMjU1ZDA5NmM3NzgiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbIioiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwiZGVmYXVsdC1yb2xlcy1tZWRpYW1lbG9uIiwidW1hX2F1dGhvcml6YXRpb24iLCJVU0VSIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvddXN0SWQiOiIxOTk0OTM4MzIiLCJncm91cHMiOlsib2ZmbGluZV9hY2Nlc3MiLCJkZWZhdWx0LXJvbGVzLW1YWlsX3ZlcmlmaWVkIjp0cnVlLCJsZXZlbCI6IjI3MzUiLCJhY2NvdW50VHlwZSI6Ik1NQ1VTVE9NRVIiLCJuYW1lIjoiTWVkaWFtZWxvbiBUZXN0IiwiY3VzdElkIjoiMTk5NDkzODMyIiwiZ3JvdXBzIjpbIm9mZmxpbmVfYWNjZXNzIiwiZGVmYXVsdC1yb2xlcy1tZWRpYW1lbG9uIiwidW1hX2F1dGhvcml6YXRpb24iLCJVU0VSIl0sInByZWZlcnJlZF91c2VybmFtZSI6Im1tc3N0ZXN0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vi3jVUNzO938_4cU0w",
    "not-before-policy": 0,
    "session_state": "967c02e5-a962-4fcd-a124-e255d096c778",
    "scope": "openid email profile"
}

Once you run this POSTrequest, make note of the access_token which needs to be used for making other subsequent POST, GET, PUT, PATCH, and DELETE requests to the MediaMelon APIs. This token needs to be included in every request as :

--header 'Authorization: Bearer eyW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgZW1haWwgcHJvZmlsZSIsImVt0eXAiOiJCZWFyZXIiLCJhenAiOiJzbWFydHNpZ2h0LWJhY2tlbmQiLCJzaWQiOiI5NjdjMDJlNS1hOTYyLTRmY2QtYTEyNC1lMjU1ZDA5NmM3NzgiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbIioiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwiZGVmYXVsdC1yb2xlcy1tZWRpYW1lbG9uIiwidW1hX2F1dGhvcml6YXRpb24iLCJVU0VSIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvddXN0SWQiOiIxOTk0OTM4MzIiLCJncm91cHMiOlsib2ZmbGluZV9hY2Nlc3MiLCJkZWZhdWx0LXJvbGVzLW1YWlsX3ZlcmlmaWVkIjp0cnVlLCJsZXZlbCI6IjI3MzUiLCJhY2NvdW50VHlwZSI6Ik1NQ1VTVE9NRVIiLCJuYW1lIjoiTWVkaWFtZWxvbiBUZXN0IiwiY3VzdElkIjoiMTk5NDkzODMyIiwiZ3JvdXBzIjpbIm9mZmxpbmVfYWNjZXNzIiwiZGVmYXVsdC1yb2xlcy1tZWRpYW1lbG9uIiwidW1hX2F1dGhvcml6YXRpb24iLCJVU0VSIl0sInByZWZlcnJlZF91c2VybmFtZSI6Im1tc3N0ZXN0YWRtaW5AbW0uY29tIiwiZ2l2ZW5fbmFtZSI6Ik1lZGlhbWVsb24iLCJmYW1pbHlfbmFtZSI6IlRlc3QiLCJlbWFpbCI6Im1tc3N0ZXN0YWRtaW5AbW0uY29tIiwiZ3JvdXAiOlsiL0EmRSAoMTk5NDkzODMyKSJdfQ.e5Kxbss5pK1Miwc9v0615ADjxAIsQWjT99kliRoJwdUTpDhd6fhj1SpZGpDg_-4zOo0BVlJ_TeMvlY9MEtnEp-RWoV4-2CNMWV8b2QEgPGkEkqF_WmNKikPGiIyJju9ulqnGT2EPGdqvwrkOgb9IYzzTIEv-0OVwSeKVG-vs3EZ03_b-p2Hs8TwD2mx8EfV_6ABf1x1tQPT8wEdvjzl91_WiHWxS4JAsvCLFwG8AHksdiHfSP247qn-3yjKDXvCXJWAVhfFor2RjJPRoDmZ-urhLi2QKRDqofBq_RiqO_b4schdMbaUPhgHMN_oSBrOx94yHK9i0jsBFM5FiGwrQsw

SmartSight Metrics and Dimensions API

This endpoint with combinations of path/query/body parameters will help you fetch the data in any combination (metrics and dimensions). Following dashboards use this API endpoint to fetch required data and present it on the platform :

  1. KPIs Dashboard

  2. Video Experience Dashboard/s

  3. Ad Experience Dashboard/s

  4. Content Insights

  5. Content Analysis

Endpoint :

GET /mm-apis/qbrData/vod/{customerId}

This FastAPI endpoint fetches data for a given customer based on various query parameters.

  • Path Parameters:

    • customerId (int, required): The customer ID for which the data is requested.

  • Query Parameters:

    • planlevel (int, required): The plan level of the customer.

    • metrics (str, required): The metrics to retrieve (e.g., viewercount, latency).

    • period (str, required): The time range for the query (in 'start=timestamp,end=timestamp' format).

    • token_info (dict, optional): Token information for authentication, validated using validate_token.

    • limit (int, default=1000): Limit the number of results.

    • offset (int, default=0): Offset for paginated results.

    • aggby (str, optional): Aggregation level for the data.

    • agg (str, optional): Aggregation function to use (e.g., sum, avg).

    • orderby (str, optional): Column to order the results by.

    • order (str, default='desc'): The order direction (ascending or descending).

    • count (int, optional): Total count of records.

    • filter (str, optional): Filters to apply on the query.

    • dimension (str, default='all'): The data dimension to query (e.g., microscope, subscriber, ad, geo).

    • granularity (str, default='auto'): The granularity of the data (e.g., minute, hour, day).

  • Functionality:

    • Validates the customer ID with the token.

    • Parses the period parameter to get the start and end times.

    • Adjusts the granularity based on the time difference in the query.

    • Determines the appropriate table view based on the given dimension and filters.

    • Constructs a ClickHouse SQL query based on the provided parameters.

    • Executes the query asynchronously with a 200-second timeout.

    • Processes the query result, converting the data into a list of dictionaries.

    • Returns the total count, page count, total records, and response data.

  • Returns:

    • A JSON response containing:

      • totalcount: The total number of records in the response.

      • pagecount: The total number of pages.

      • totalrecords: The total number of records in the query.

      • response: A list of dictionaries, each representing a row of data.

SmartSight Smartquery API

This endpoint with combinations of path/query/body parameters will help you fetch content insights, engagement behavior data. Following dashboards use this API endpoint to fetch required data and present it on the platform :

  1. Content Paths

  2. Subscriber Insight

Endpoint :

GET /mm-apis/smartQuery/{customerId}

Executes a Smart Query with various filtering, period, and aggregation options.

  • Path Parameters:

    • customerId (int, required): The customer ID for which the data is requested.

  • Query Parameters:

    • planlevel (int, required): The plan level of the customer.

    • queryname (str, required): The query to execute.

    • period (str, required): The time range for the query (in 'start=timestamp,end=timestamp' format).

    • filter (str, optional): Filters to apply on the query.

    • limit (int, default=1000): Limit the number of results.

    • offset (int, default=0): Offset for paginated results.

    • granularity (str, default='auto'): The granularity of the data (e.g., minute, hour, day).

    • querycache (str, default='True'): Whether to use query caching.

    • queryId (str, optional): uuid, to track the query.

  • Returns:

    • A JSON object containing:

      • totalcount: Total number of records in the response.

      • pagecount: Total number of pages.

      • totalrecords: Total number of records found.

      • response: A list of results based on the query.

SmartSight Error API

This endpoint with combinations of path/query/body parameters will help you fetch errors and error heatmaps data. Following dashboard use this API endpoint to fetch required data and present it on the platform :

  1. Error Heatmap

Endpoint :

GET /mm-apis/error/{customerId}
  • Path Parameters:

    • customerId (int, required): The customer ID for which the data is requested.

  • Query Parameters:

    • planlevel (int, required): The plan level of the customer.

    • metrics (str, required)): The metrics to retrieve (e.g., viewercount, latency).

    • period (str, required)): The time range for the query (in 'start=timestamp,end=timestamp' format).

    • limit (int, default=1000): Limit the number of results.

    • offset (int, default=0): Offset for paginated results.

    • aggby (str, optional): Aggregation level for the data.

    • agg (str, optional): Aggregation function to use (e.g., sum, avg).

    • orderby (str, optional): Column to order the results by.

    • order (str, default='desc'): The order direction (ascending or descending).

    • count (int, optional): Total count of records.

    • filter (str, optional): Filters to apply on the query.

    • dimension (str, default='all'): The data dimension to query (e.g., microscope, subscriber, ad, geo).

    • granularity (str, default='auto'): The granularity of the data (e.g., minute, hour, day).

    • queryId (str, optional): uuid, to track the query.

  • Returns:

    • A JSON object containing:

      • totalcount: Total number of records in the response.

      • pagecount: Total number of pages.

      • totalrecords: Total number of records found.

      • response: A list of results based on the query.

SmartSight Alert API

This endpoint with combinations of path/query/body parameters will help you fetch alerts data. Following dashboard use this API endpoint to fetch required data and present it on the platform :

  1. Alerts

Endpoint :

GET /mm-apis/getAIAlerts/{customerId}
  • Path Parameters:

    • customerId (int, required): The customer ID for which the data is requested.

  • Query Parameters:

    • planlevel (int, required): The plan level of the customer.

    • period (str, required)): The time range for the query (in 'start=timestamp,end=timestamp' format).

    • limit (int, default=1000): Limit the number of results.

    • offset (int, default=0): Offset for paginated results.

    • orderby (str, optional): Column to order the results by.

    • order (str, default='desc'): The order direction (ascending or descending).

  • Returns

    • An array of JSON objects containing:

      • response: A list of results based on the query.

For further information on how to fetch data programmatically using above API endpoint along with path/query/body parameters, refer to guide.

PreviousQBR StreamingNextMetric and Dimensions Dictionary

Last updated 6 months ago

Was this helpful?

For further information on how to fetch this data programmatically using API endpoints along with path/query/body parameters, refer to and guides.

For further information on how to fetch data programmatically using above API endpoint along with path/query/body parameters, refer to guide.

For further information on how to fetch data programmatically using above API endpoint along with path/query/body parameters, refer to guide.

username string

A body parameter in form of a string with Smartsight Username value

password string

A body parameter in form of a string with Smartsight Password value

grant_type string

A body parameter in form of a string with "password" as value

client_id string

A body parameter in form of a string set to smartsight-backend

scope string

A body parameter in form of a string set to openid

Video Experience
Ad Experience
Smartquery Insights
Errors