Streamhub API (2.0.0)

Download OpenAPI specification:Download

Introduction

Welcome to the Streamhub API documentation! This guide provides all the necessary information to integrate and interact with our API seamlessly. Our API offers robust and flexible access to a wide range of features designed to enhance your application’s capabilities.

Getting Started

Login without MFA

Obtain the authentication token using the /login api.

From the returned response, accessToken can be used in Authorization: Bearer <token> header for authenticating requests.

Login with MFA

  1. Get MFA Token from the /login api.

  2. Obtain the final authentication token from /login/mfa by passing the below in request body

    1. OTP received in registered email.
    2. MFA token and OTP token obtained from Step 1.
    3. User email used in the Step 1 to initate login.

Get Datasets

GET: /dataset

Retrieve a list of available datasets to get the details related to dimensions that can be used in reports.

If you need to retrieve a specific dataset, this API accepts publicId query parameter to specify the individual dataset.

Create Report

POST: /report

This creates a report object based on configuration and settings specified in the body json payload.

Get Reports

GET: /report

Retrieve a list of configured reports available to the user.

If you need to retrieve a specific report, this API accepts publicId query parameter to specify the individual report.

Run Compute

POST: /report/compute/{reportId}

Run a computation for the specified reportId.

Get Results

GET: /report/compute/results/{queryId}

Get the results of the computation request. This API will need a unique queryId from the response of Run Compute API.

Authentication

APIs to retrieve Bearer tokens and manage Auth

Non-MFA Login

Request Body schema: application/json
required
username
string
password
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string"
}

MFA Login

Completes the login process with MFA.

Request Body schema: application/json
required
binding_code
string

One-time password received in the registered email.

oob_code
string

OTP token fetched from initial login response.

mfa_token
string

MFA token fetched from initial login response.

username
string

The user's email ID.

Responses

Request samples

Content type
application/json
{
  • "binding_code": "123456",
  • "oob_code": "some-otp-token",
  • "mfa_token": "some-mfa-token",
  • "username": "user@example.com"
}

Response samples

Content type
application/json
{
  • "accessToken": "authorized-token"
}

Insights

APIs to operate on datasets and reports objects

Get Datasets

This endpoint retrieves datasets that are integrated to Streamhub's system. There are different types of datasets i.e 1st party, 2nd party & third party data from customers

Authorizations:
Bearer
query Parameters
publicId
string
Example: publicId=customer:census_programs

Specify the dataset publicId to get specific dataset

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Reports

This endpoint allows users to fetch the list of configured reports.

Authorizations:
Bearer
query Parameters
publicId
string
Example: publicId=sampleCustomer:census_programs:highlights

Specify the report publicId to get specific report

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create Report

This endpoint allows users to create a report with user defined properties. Users can specify filters and query settings to customize the report.

Authorizations:
Bearer
Request Body schema: application/json
required

Report Configuration Settings

publicId
required
string or null

The public unique identifier for the report. Keep null for creating report.

name
required
string

A name for the report.

description
string

A description for the report.

required
object

Group filters for the report. Multiple combination of the filter can be applied to generate a report.

customerPublicId
required
string

The unique public identifier for the customer.

visualisationType
string

The type of visualisation for the report

Responses

Request samples

Content type
application/json
{
  • "publicId": null,
  • "name": "sampleReports",
  • "description": "This is the sample report to analyse views",
  • "groupFilters": {
    },
  • "customerPublicId": "sampleCustomer",
  • "visualisationType": "datagrid"
}

Response samples

Content type
application/json
{
  • "_id": "5eeb531cca6f48001998ee18",
  • "publicId": "sampleCustomer:5eeb531cca6f48001998ee18",
  • "name": "sampleReport",
  • "description": "This is a sample description of the report",
  • "groupFilters": {
    },
  • "created": "2024-06-14T04:46:54Z",
  • "isDeleted": false,
  • "systemGenerated": false,
  • "authorId": "user@example.com",
  • "authorName": "sampleCustomer Test User",
  • "authorGroupId": 123,
  • "customerPublicId": "sampleCustomer",
  • "visualisationType": "datagrid",
  • "isHidden": false,
  • "isMetricSwitcherEnabled": false,
  • "isWidgetFilterEnabled": false,
  • "savedFilters": [ ],
  • "isSelectedTotalEnabled": false,
  • "reportBuilderType": "general",
  • "hideZero": true,
  • "isOverallEnabled": false,
  • "useCTEs": false
}

Report Compute

The POST method to compute report. This will return results if this request is served from cache. Otherwise, it will return a unique identifier, queryId, which can be used with /report/compute/results/{queryId} API to poll the results.

Authorizations:
Bearer
path Parameters
reportId
required
string
Example: streamhub:census_programs:highlights
query Parameters
applicationId
required
string
Example: applicationId=syntese
moduleId
required
string
Example: moduleId=analytics
async
string
Example: async=true
Request Body schema: application/json
required
required
object

Responses

Request samples

Content type
application/json
{
  • "body": {
    }
}

Response samples

Content type
application/json
{
  • "report": {
    },
  • "columns": {
    },
  • "items": [
    ],
  • "query_id": "string",
  • "contains_result": true
}

Report Compute Results

The polling GET method to get results of the compute request.

Authorizations:
Bearer
path Parameters
queryId
required
string

The queryId from the /report/compute/{reportId} API call

query Parameters
applicationId
required
string
Example: applicationId=syntese
moduleId
required
string
Example: moduleId=analytics
service
required
string
Example: service=dmp
reportId
required
string
Example: reportId=streamhub:default
overrideReport
string
Example: overrideReport=true

Responses

Response samples

Content type
application/json
{
  • "report": {
    },
  • "columns": {
    },
  • "items": [
    ],
  • "query_id": "string",
  • "contains_result": true
}