Download OpenAPI specification:Download
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.
Obtain the authentication token using the /login api.
From the returned response, accessToken
can be used in Authorization: Bearer <token>
header for authenticating requests.
Get MFA Token from the /login api.
Obtain the final authentication token from /login/mfa by passing the below in request body
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.
POST: /report
This creates a report object based on configuration and settings specified in the body json payload.
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.
POST: /report/compute/{reportId}
Run a computation for the specified reportId.
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.
Completes the login process with MFA.
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. |
{- "binding_code": "123456",
- "oob_code": "some-otp-token",
- "mfa_token": "some-mfa-token",
- "username": "user@example.com"
}
{- "accessToken": "authorized-token"
}
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
publicId | string Example: publicId=customer:census_programs Specify the dataset publicId to get specific dataset |
[- {
- "_id": "string",
- "id": 0,
- "publicId": "string",
- "name": "string",
- "db": "string",
- "table": "string",
- "dimensions": {
- "property1": {
- "id": "string",
- "name": "string",
- "mapping": "string",
- "dtype": "string",
- "isMetric": true,
- "isUserAttribute": true,
- "isHidden": true,
- "collectMetrics": true,
- "displayDimension": "string",
- "varType": "string",
- "refObjectType": "string",
- "isRestricted": true,
- "datasetPublicId": "string",
- "isHighCardinality": true
}, - "property2": {
- "id": "string",
- "name": "string",
- "mapping": "string",
- "dtype": "string",
- "isMetric": true,
- "isUserAttribute": true,
- "isHidden": true,
- "collectMetrics": true,
- "displayDimension": "string",
- "varType": "string",
- "refObjectType": "string",
- "isRestricted": true,
- "datasetPublicId": "string",
- "isHighCardinality": true
}
}, - "isDeleted": true,
- "type": "string",
- "names": {
- "en": "string",
- "jp": "string"
}, - "groupTag": {
- "en": "string",
- "jp": "string"
}, - "category": {
- "en": "string",
- "jp": "string"
}, - "isHidden": true,
- "hasUserDimensions": true,
- "dataType": "string",
- "reportBuilderType": "string"
}
]
This endpoint allows users to fetch the list of configured reports.
publicId | string Example: publicId=sampleCustomer:census_programs:highlights Specify the report publicId to get specific report |
[- {
- "_id": "5eeb531cca6f48001998ee18",
- "publicId": "sampleCustomer:5eeb531cca6f48001998ee18",
- "name": "sampleReport",
- "description": "This is a sample description of the report",
- "groupFilters": {
- "groupOperator": "UNION",
- "groupChildren": [
- {
- "groupRule": {
- "name": "G0",
- "query": {
- "datasetId": 0,
- "dimensions": "sampleCustomer:census_programs:views",
- "filters": {
- "children": [
- {
- "rule": { },
- "filters": { }
}
], - "operator": "All"
}, - "metricFilters": {
- "children": [
- { }
], - "operator": "All"
}, - "sortBy": [ ],
- "nbResults": 250,
- "authFilters": {
- "datasets": [
- {
- "name": null,
- "filters": { }
}
]
}, - "dimensionProperties": [
- {
- "dimension": "sampleCustomer:census_programs:views",
- "displayName": "views"
}
]
}
}
}
]
}, - "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
}
]
This endpoint allows users to create a report with user defined properties. Users can specify filters and query settings to customize the report.
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 |
{- "publicId": null,
- "name": "sampleReports",
- "description": "This is the sample report to analyse views",
- "groupFilters": {
- "groupOperator": "UNION",
- "groupChildren": [
- {
- "groupRule": {
- "name": "G0",
- "query": {
- "datasetId": 0,
- "dimensions": [
- "sampleCustomer:census_programs:views",
- "sampleCustomer:dim_device:deviceTypeName"
], - "resolution": null,
- "startDate": null,
- "endDate": null,
- "filters": {
- "children": [
- {
- "rule": {
- "dimension": null,
- "value": [ ],
- "operator": null
}, - "filters": {
- "children": [ ],
- "operator": null
}
}
], - "operator": "All"
}, - "sortBy": [ ],
- "nbResults": 250,
- "primaryDatasetPublicId": null,
- "dimensionProperties": [
- {
- "dimension": "vr:census_programs:views",
- "primaryDatasetPublicId": "vr:census_programs",
- "isMetric": true
}, - {
- "dimension": "vr:dim_device:deviceTypeName",
- "primaryDatasetPublicId": "vr:census_programs",
- "isMetric": false
}
]
}
}, - "groupFilters": {
- "groupOperator": "UNION",
- "groupChildren": [ ]
}
}
]
}, - "customerPublicId": "sampleCustomer",
- "visualisationType": "datagrid"
}
{- "_id": "5eeb531cca6f48001998ee18",
- "publicId": "sampleCustomer:5eeb531cca6f48001998ee18",
- "name": "sampleReport",
- "description": "This is a sample description of the report",
- "groupFilters": {
- "groupOperator": "UNION",
- "groupChildren": [
- {
- "groupRule": {
- "name": "G0",
- "query": {
- "datasetId": 0,
- "dimensions": "sampleCustomer:census_programs:views",
- "filters": {
- "children": [
- {
- "rule": {
- "dimension": null,
- "value": [ ],
- "operator": null
}, - "filters": {
- "children": [ ],
- "example": null,
- "operator": null
}
}
], - "operator": "All"
}, - "metricFilters": {
- "children": [
- { }
], - "operator": "All"
}, - "sortBy": [ ],
- "nbResults": 250,
- "authFilters": {
- "datasets": [
- {
- "name": "sampleCustomer:dim_device",
- "filters": {
- "children": [ ],
- "operator": null
}
}
]
}, - "dimensionProperties": [
- {
- "dimension": "sampleCustomer:census_programs:views",
- "displayName": "views"
}
]
}
}
}
]
}, - "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
}
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.
reportId required | string Example: streamhub:census_programs:highlights |
applicationId required | string Example: applicationId=syntese |
moduleId required | string Example: moduleId=analytics |
async | string Example: async=true |
required | object |
{- "body": {
- "groupFilters": {
- "groupOperator": "UNION",
- "groupChildren": [
- {
- "groupRule": {
- "name": "G0",
- "query": {
- "datasetId": 0,
- "dimensions": [
- "sampleCustomer:census_programs:views",
- "sampleCustomer:dim_device:deviceTypeName"
], - "resolution": null,
- "startDate": null,
- "endDate": null,
- "filters": {
- "children": [
- {
- "rule": { },
- "filters": { }
}
], - "operator": "All"
}, - "sortBy": [ ],
- "nbResults": 250,
- "primaryDatasetPublicId": null,
- "dimensionProperties": [
- {
- "dimension": "sampleCustomer:census_programs:views",
- "primaryDatasetPublicId": "sampleCustomer:census_programs",
- "isMetric": true
}, - {
- "dimension": "sampleCustomer:dim_device:deviceTypeName",
- "primaryDatasetPublicId": "sampleCustomer:census_programs",
- "isMetric": false
}
]
}
}, - "groupFilters": {
- "groupOperator": "UNION",
- "groupChildren": [ ]
}
}
]
}, - "visualisationType": "datagrid"
}
}
{- "report": {
- "publicId": "string",
- "name": "string",
- "description": "string",
- "visualisationType": "string",
- "isMetricSwitcherEnabled": true,
- "names": { },
- "tags": { },
- "descriptions": { }
}, - "columns": {
- "total": 0,
- "metadata": [
- { }
]
}, - "items": [
- { }
], - "query_id": "string",
- "contains_result": true
}
The polling GET method to get results of the compute request.
queryId required | string The |
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 |
{- "report": {
- "publicId": "string",
- "name": "string",
- "description": "string",
- "visualisationType": "string",
- "isMetricSwitcherEnabled": true,
- "names": { },
- "tags": { },
- "descriptions": { }
}, - "columns": {
- "total": 0,
- "metadata": [
- { }
]
}, - "items": [
- { }
], - "query_id": "string",
- "contains_result": true
}