• Skip to Search
  • Skip to Content
  • Skip to Side Navigation
Getting StartedSDK ReferenceGlossary
  • Home
  • Getting Started
  • SDK Reference
  • Portal
  • How-To
  • Troubleshooting
  • FAQs
  • Reference
  • Glossary
REST API
Web SDK
Android SDK
iOS SDK
Unity SDK
React Native SDK
EdgeAuth SDK
  • Overview
  • Channel
  • Room
  • Stream
  • RTMP
  • Transformation
  • Reporting
  • Analytics
  • Notification
  • Live and On-Demand

Analytics API

APIs for generating analytics reports.

Generate a Concurrent Viewing Streams Report

This API generates a concurrent viewing streams report for the given interval.

In order to be able to generate reports, your account needs to be provisioned accordingly. Please contact your primary Phenix technical support contact if you wish to use analytics.

Request

Send a PUT request to pcast/streams/concurrent endpoint as shown:

HTTP
1PUT pcast/streams/concurrent HTTP/1.1
2Host: pcast.phenixrts.com
3Accept: application/json
4Content-Type: application/json
5Content-Length: 174
6Authorization: Basic YXBwbGljYXRpb25JZDpzZWNyZXQ=
7
8{
9 "concurrentViewingStreamsReport": {
10 "applicationIds": ["example.com"],
11 "start": "2020-01-01T00:00:00Z",
12 "end": "2020-01-02T00:00:00Z"
13 }
14}
cURL
1$ curl https://pcast.phenixrts.com/pcast/streams/concurrent \
2-u <applicationId>:<secret> \
3-H "Accept: text/csv" \
4-H "Content-Type: application/json" \
5-X PUT \
6-d '{
7 "concurrentViewingStreamsReport": {
8 "applicationIds": ["example.com"],
9 "start": "2020-01-01T00:00:00Z",
10 "end": "2020-01-02T00:00:00Z"
11 }
12 }'
13--remote-name
14--remote-header-name

Request Headers

HeaderDescription
Authorization (required)Use HTTP Basic Authentication with your applicationId and secret

Request Fields

FieldDescription
concurrentViewingStreamsReport (required)See ConcurrentViewingStreamsReport object below

ConcurrentViewingStreamsReport Object

FieldDescription
applicationIds (optional)Array of applications IDs to report for. By default, it will report viewing streams for the application ID from credentials.
streamIds (optional)Array of origin stream IDs to report for. Limits the report to viewing streams of just these origin streams.
channelIds (optional)Array of channel IDs to report for. Limits the report to just these channel IDs.
channelAliases (optional)Array of channel aliases to report for. Limits the report to just these channel aliases.
originTags (optional)Array of origin Tags to report for. Limits the report to viewing streams of only origin streams with these tags.
viewerTags (optional)Array of viewer Tags to report for. Limist the report to only viewing streams with these tags.
start (required)The report start time. Either an RFC3339 timestamp string or an integer of UNIX epoch time in milliseconds.
end (required)The report end time. Either an RFC3339 timestamp string or an integer of UNIX epoch time in milliseconds.

Note: All filter conditions are cumulative.

Response

The response is in CSV format.

Report Response Fields

ColumnDescription
ApplicationIdApplication ID for which number of concurrent viewing streams is counted
TimestampThe time at which number of concurrent viewing streams is counted
ConcurrentNumber of concurrent viewing streams
HTTP
1HTTP/1.1 200 OK
2Content-Type: application/json; charset=utf-8
3Content-Length: 85
4Content-Disposition: attachment; filename="20200204T171148Z-START20200101T000000Z-END20200102T000000Z-ConcurrentViewingStreams-RWYkT1.csv"
5
6ApplicationId,Timestamp,Concurrent
7example.com,2020-01-01 20:16:38,200
8example.com,2020-01-01 20:16:39,15
9example.com,2020-01-01 20:16:40,2
cURL
1curl: Saved to filename '20200204T171148Z-START20200101T000000Z-END20200102T000000Z-ConcurrentViewingStreams-RWYkT1.csv'

If the request fails, the platform will return a failed response that contains a "status" field. The HTTP status code is set according to the "status" field.

HTTP
1HTTP/1.1 400 Bad request
2Content-Type: application/json; charset=utf-8
3Content-Length: 37
4
5{"status":"excessive-report-interval"}
cURL
1$ cat concurrent
2{
3 "status":"excessive-report-interval"
4}

Concurrent Viewing Streams Report API Response Fields

FieldDescription
statusSee status codes below

Concurrent Viewing Streams Report API Status Codes

HTTPStatusRetryDescription
200 OKokneverReport was successfully created.
400 Bad RequestvariesneverIndicates an issue with the request.
400 Bad Requestexcessive-report-intervalneverThe interval for the report exceeds 1 day.
400 Bad Requestperiod-start-outside-supported-windowneverThe year of the start of period is more than 1 year before the current year.
400 Bad Requestperiod-end-must-be-in-pastneverThe end of period is in future.
400 Bad Requestperiod-end-must-be-after-startneverThe end of period is less than or equal to the start of the period.
400 Bad RequestunsupportedneverThe parameter combination is not supported.
401 UnauthorizedunauthorizedneverThe streaming platform was not able to authorize the provided credentials.
4XXvariesneverIndicates an issue with the request.
503 Service UnavailablecapacityonceThe system is temporarily overloaded. Please try again later.
5XXvariesonce immediately, then exponential backoffA transient server error.
Error Responses: Please be aware that some server errors 5XX and request validation errors 400 and 401 may result in an arbitrary response body not encoded in JSON.
Page Content
    Copyright 2023 © Phenix RTS
    Privacy Policy | Terms of Service
    v2023-01-31T21:25:10