• 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

Stream API

APIs for streams let you publish, subscribe, destroy and manage streams. In addition, the APIs let you create and fetch replays.

Publishing a URI

This API allows to publish a stream from a URI.

Publishing a URI Request

Send a PUT request to the pcast/:tenancy/stream/publish/uri/:type endpoint as shown:

HTTP
1PUT pcast/<applicationId>/stream/publish/uri/<type> HTTP/1.1
2Authorization: Bearer <edgeAuthToken>
3Host: pcast.phenixrts.com
4Accept: application/json
5Content-Type: application/json
6
7{
8 "uri": "<uri>",
9 "options": [<options>]
10}
cURL
1$ curl https://pcast.phenixrts.com/pcast/<applicationId>/stream/publish/uri/<type> \
2-H "Authorization: Bearer <edgeAuthToken>" \
3-H "Accept: application/json" \
4-H "Content-Type: application/json" \
5-X PUT \
6-d '{
7 "uri": "<uri>",
8 "options": [<options>]
9 }'

Request Headers

HeaderDescription
Authorization (required)Use Bearer authentication with an EdgeAuthToken

Request URI

ComponentDescription
applicationId (required)The application ID that the request belongs to
type (required)The remote URI type such as mp4, m3u8, udp, srt,...

Request Fields

FieldDescription
uri (required)The URI to publish such as srt://103.19.109.140:4201
options (optional)For future use

Publishing a URI Request (multipart/form-data)

Send a POST request to the pcast/:tenancy/stream/publish/uri/:type endpoint as shown:

HTTP
1POST pcast/<applicationId>/stream/publish/uri/<type> HTTP/1.1
2Host: pcast.phenixrts.com
3Accept: application/json
4Content-Type: multipart/form-data
5
6{
7 "edgeAuthToken": "<edgeAuthToken>",
8 "uri": "<uri>",
9 "options": [<options>]
10}
cURL
1$ curl https://pcast.phenixrts.com/pcast/<applicationId>/stream/publish/uri/<type> \
2-H "Accept: application/json" \
3-H "Content-Type: multipart/form-data" \
4-X POST \
5-F jsonBody='{
6 "edgeAuthToken": "<edgeAuthToken>",
7 "uri": "<uri>",
8 "options": [<options>]
9 }'

Request URI

ComponentDescription
applicationId (required)The application ID that the request belongs to
type (required)The remote URI type such as mp4, m3u8, udp, srt,...

Request Fields

FieldDescription
edgeAuthToken (required)EdgeAuthToken used to connect and authenticate to the platform and publish the stream
uri (required)The URI to publish such as srt://73.103.226.97:4201
options (optional)For future use

Publishing a URI Response

The platform will return a successful response that contains a "status" field. The HTTP status code is set according to the "status" field.

HTTP
1HTTP/1.1 200 OK
2Content-Type: application/json; charset=utf-8
3Content-Length: 518
4
5{"status":"ok","streamId":"us-central#us-central1-c.K3hpFbOX.20210913.I9LYKcSz","sharedSecret":"DIGEST:eyJhcHBsaWNhdGlvbklkIjoiZGVtbyIsImRpZ2VzdCI6ImlkdG5oVjc2WEFseUsxSWdNTFJMbkdET01CLzhzdE84N0JEUkNKNkdzNjZzNmFPeEJ5a3RlQzVuU09LSlVUWWxqVGpVdHRJVnphcHJHdlg4THgxUkRBPT0iLCJ0b2tlbiI6IntcInN0cmVhbUlkXCI6XCJldXJvcGUtd2VzdCNldXJvcGUtd2VzdDEtYi40NU9EMDdaQS4yMDIxMDkxNS5JRVp3YTdmeFwiLFwiaW5zdGFuY2VSb3V0ZUtleVwiOlwidW5pY2FzdC5ldXJvcGUtd2VzdC5ldXJvcGUtd2VzdDEtYi40NU9EMDdaQVwiLFwiZXhwaXJlc1wiOjE2MzIzMDM1NDAzNDl9In0=","options":[]}```
cURL
1{
2 "status": "ok",
3 "streamId": "us-central#us-central1-c.K3hpFbOX.20210913.I9LYKcSz",
4 "sharedSecret": "DIGEST:eyJhcHBsaWNhdGlvbklkIjoiZGVtbyIsImRpZ2VzdCI6ImlkdG5oVjc2WEFseUsxSWdNTFJMbkdET01CLzhzdE84N0JEUkNKNkdzNjZzNmFPeEJ5a3RlQzVuU09LSlVUWWxqVGpVdHRJVnphcHJHdlg4THgxUkRBPT0iLCJ0b2tlbiI6IntcInN0cmVhbUlkXCI6XCJldXJvcGUtd2VzdCNldXJvcGUtd2VzdDEtYi40NU9EMDdaQS4yMDIxMDkxNS5JRVp3YTdmeFwiLFwiaW5zdGFuY2VSb3V0ZUtleVwiOlwidW5pY2FzdC5ldXJvcGUtd2VzdC5ldXJvcGUtd2VzdDEtYi40NU9EMDdaQVwiLFwiZXhwaXJlc1wiOjE2MzIzMDM1NDAzNDl9In0=",
5 "options": []
6}

Publish URI API Status Codes

HTTPStatusRetryDescription
200 OKokneverStream has been successfully published.
400 Bad RequestvariesneverIndicates an issue with the request.
401 UnauthorizedunauthorizedneverThe streaming platform was not able to authorize the provided credentials.
402 Unauthorizedgeo-restrictedneverThe access to the content is geo-restricted.
403 Unauthorizedgeo-blockedneverThe access to the content is geo-blocked.
409 Conflictconflicting-capabilityneverIngest capabilities are conflicting. Only one must be specified at a time.
415 Unsupported Media Typeinvalid-source-urineverThe URI to publish is not a valid URI.
4XXvariesneverIndicates an issue with the request.
503 Service UnavailablecapacityonceThe system is temporarily overloaded. Please try again later.
504 Gateway Timeoutrate-limitedonce immediately, then exponential backoffThe 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.

Publish URI API Response fields

FieldDescription
statusSee Status Codes
streamIdThe stream ID of the ingest stream
sharedSecretThe shared secret used in follow on operations on the stream
optionsFor future use

Fetching a Replay Manifest

This API allows to create and fetch replay manifests.

Fetching a Replay Manifest Request

Send a Get request to the /pcast/:tenancy/stream/replay/:type.m3u8 endpoint as shown:

HTTP
1GET /pcast/:tenancy/stream/replay/:type.m3u8?edgeAuthToken=<edgeAuthToken>&startTime=<startTime>&endTime=<endTime> HTTP/1.1
2Host: pcast.phenixrts.com
3Accept: application/json
cURL
1$ curl https://pcast.phenixrts.com/pcast/<applicationId>/stream/replay/primary.m3u8?edgeAuthToken=<edgeAuthToken>&startTime=<startTime>&endTime=<endTime> \
2-x GET \
3-H "Accept: application/json" \
4-H "Content-Type: application/json"

Request URI

ComponentDescription
applicationId (required)The application ID that the request belongs to.
type (required)The manifest type such as primary.m3u8 for for primary manifest or xhd.m3u8 for quality manifest.

Request Parameters

FieldDescription
edgeAuthToken (required)EdgeAuthToken used to connect and authenticate to the platform and subscribe to a stream
startTime (required)The date, formatted as 'yyyy-MM-dd'T'HH:mm:ss.SSS'Z'', from which replay should start
endTime (required)The date, formatted as 'yyyy-MM-dd'T'HH:mm:ss.SSS'Z'', until which replay should last
apiVersion (optional)The API version the message conforms to. Default to '0'
httpRoundTripTime (optional)The round trip time

Fetching a Replay Manifest Response

The platform will return a successful response that contains a playlist manifest. Or it will return error object with status on failure.

Success response example for primary manifest

HTTP
1HTTP/1.1 200 OK
2Content-Type: application/vnd.apple.mpegurl; charset=utf-8
3Content-Length: 427
4#EXTM3U
5
6#EXT-X-STREAM-INF:PROGRAM-ID=1,RESOLUTION=1920x1080,CODECS="avc1.640029,mp4a.40.2",BANDWIDTH=5628000,AVERAGE-BANDWIDTH=5628000,FRAME-RATE=30
7xhd.m3u8?tenancy=test&edgeAuthToken=DIGEST%3AeyJhcHBsaWNhdGlvbklkIjoidGVzdCIsImRpZ2VzdCI6IjFuUU90ZnpKTmwwRUVLaHVBWGE4YWd0RGNNaGdGbEhTbksyRElsNTlTS0RTZ2xlUjc3c3NpTmRQcGdhMnZYVEhuSEJCdWIwQmdYRTQ2a3ZvbmNBcmFBPT0iLCJ0b2tlbiI6IntcImV4cGlyZXNcIjoxOTQ0MjE2MDAwMDAwLFwiY2FwYWJpbGl0aWVzXCI6W1wicmVwbGF5XCJdLFwib3JpZ2luU3RyZWFtSWRcIjpcImxvY2FsI3N0YW5kYWxvbmUuVFpkcnkwdjcuMjAyMTA5MTQuUFN5V1E2dk1cIixcInJlcXVpcmVkVGFnXCI6XCJyb29tSWQ6bG9jYWwjdGVzdCN0ZXN0Q2hhbm5lbC40UjBsVHU5Y1o3NjNcIn0ifQ%3D%3D&startTime=Tue+Sep+14+2021+08%3A05%3A52+GMT%2B0000&endTime=Tue+Sep+14+2021+08%3A06%3A02+GMT%2B0000&options=
8...
cURL
1#EXTM3U
2
3#EXT-X-STREAM-INF:PROGRAM-ID=1,RESOLUTION=1920x1080,CODECS="avc1.640029,mp4a.40.2",BANDWIDTH=5628000,AVERAGE-BANDWIDTH=5628000,FRAME-RATE=30
4xhd.m3u8?tenancy=test&edgeAuthToken=DIGEST%3AeyJhcHBsaWNhdGlvbklkIjoidGVzdCIsImRpZ2VzdCI6IjFuUU90ZnpKTmwwRUVLaHVBWGE4YWd0RGNNaGdGbEhTbksyRElsNTlTS0RTZ2xlUjc3c3NpTmRQcGdhMnZYVEhuSEJCdWIwQmdYRTQ2a3ZvbmNBcmFBPT0iLCJ0b2tlbiI6IntcImV4cGlyZXNcIjoxOTQ0MjE2MDAwMDAwLFwiY2FwYWJpbGl0aWVzXCI6W1wicmVwbGF5XCJdLFwib3JpZ2luU3RyZWFtSWRcIjpcImxvY2FsI3N0YW5kYWxvbmUuVFpkcnkwdjcuMjAyMTA5MTQuUFN5V1E2dk1cIixcInJlcXVpcmVkVGFnXCI6XCJyb29tSWQ6bG9jYWwjdGVzdCN0ZXN0Q2hhbm5lbC40UjBsVHU5Y1o3NjNcIn0ifQ%3D%3D&startTime=Tue+Sep+14+2021+08%3A05%3A52+GMT%2B0000&endTime=Tue+Sep+14+2021+08%3A06%3A02+GMT%2B0000&options=

Replay Manifest API Status Codes

HTTPStatusRetryDescription
200 OKokneverChannel has been successfully created.
400 Bad RequestvariesneverIndicates an issue with the request.
401 UnauthorizedunauthorizedneverThe streaming platform was not able to authorize the provided credentials.
402 Unauthorizedgeo-restrictedneverThe access to the content is geo-restricted.
403 Unauthorizedgeo-blockedneverThe access to the content is geo-blocked.
408 Request Timeoutrequest-timeoutonce immediately, then exponential backoffRequest timed out likely due to temporary resource or network conditions. Please try again.
4XXvariesneverIndicates an issue with the request.
503 Service UnavailablecapacityonceThe system is temporarily overloaded. Please try again later.
504 Gateway Timeoutrate-limitedonce immediately, then exponential backoffThe system is temporarily overloaded. Please try again later.
5XXvariesonce immediately, then exponential backoffA transient server error.
Page Content
    Copyright 2023 © Phenix RTS
    Privacy Policy | Terms of Service
    v2023-01-31T21:25:10