• 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

Live and On-Demand APIs

Deleting An On-Demand Stream

This API lets you delete an on-demand stream.

Delete Stream Request

You can delete an on-demand stream by using a DELETE request.

HTTP
1DELETE /pcast/stream/archive HTTP/1.1
2Host: pcast.phenixrts.com
3Accept: application/json
4Content-Type: application/json
5Content-Length: 124
6
7{
8 "applicationId": "<applicationId>",
9 "secret": "<secret>",
10 "streamId": "<streamId>",
11 "reason": "<reason>"
12}
cURL
1$ curl https://pcast.phenixrts.com/pcast/stream/archive \
2-H "Accept: application/json" \
3-H "Content-Type: application/json" \
4-X DELETE \
5-d '{
6 "applicationId": "<applicationId>",
7 "secret": "<secret>",
8 "streamId": "<streamId>",
9 "reason": "<reason>"
10 }'

The Content-Length header is automatically populated by curl. If using another method to access the API, you must calculate and populate the Content-Length header.

Request Fields

FieldDescription
applicationId (required)Your application ID
secret (required)Your application secret
streamId (required)The stream ID of the on-demand stream that you want to delete
reason (required)A reason for why the stream is deleted for your records.

Delete Stream 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: 15
4
5{"status":"ok"}
cURL
1{
2 "status":"ok"
3}

Status Codes

HTTPStatusRetryDescription
200 OKokneverStream was successfully terminated.
400 Bad RequestvariesneverIndicates an issue with the request itself.
401 UnauthorizedunauthorizedneverThe streaming platform was not able to authorize the provided credentials.
404 Not Foundnot-foundneverThe specified stream is not known to the platform.
408 Request Timeoutrequest-timeoutonce immediately, then exponential backoffRequest timed out likely due to temporary resource or network conditions. Please try again.
409 Conflictnot-endedafter terminating the streamStream has not ended. On-demand streams can not be deleted until the stream has terminated. To forcefully terminate a stream, see Terminating A Stream.
410 Gonealready-deletedneverThe specified stream has already been deleted.
410 Goneresource-unavailableneverThe resources that hosted the specified stream are unavailable.
4XXvariesneverIndicates an issue with the request itself.
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.

Get Playlist Information

This API allows to get information for all the playlists of a live or on-demand stream.

Get Playlist Request

You can send a PUT request to the /pcast/stream/playlist endpoint as shown:

HTTP
1PUT /pcast/stream/playlist HTTP/1.1
2Host: pcast.phenixrts.com
3Accept: application/json
4Content-Type: application/json
5Content-Length: 98
6
7{
8 "applicationId": "<applicationId>",
9 "secret": "<secret>",
10 "streamId": "<streamId>"
11}
cURL
1$ curl https://pcast.phenixrts.com/pcast/stream/playlist \
2-H "Accept: application/json" \
3-H "Content-Type: application/json" \
4-X PUT \
5-d '{
6 "applicationId": "<applicationId>",
7 "secret": "<secret>",
8 "streamId": "<streamId>"
9 }'

The Content-Length header is automatically populated by curl. If using another method to access the API, you must calculate and populate the Content-Length header.

Request Fields

FieldDescription
applicationId (required)Your application ID
secret (required)Your application secret
streamId (required)The stream ID of the stream whose playlist URIs are requested

Get Playlist 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: 698
4
5{"status":"ok","playlists":[{"name":"live-720.mpd","type":"Dash","uri":"https://pcast.phenixrts.com/video/application-id/us-central#us-central1-c.YfMSNkZM.20171121.9VuaQSac/live-720.mpd","isPrimary":false,"isVariant":false,"isProtected":false,"isEncrypted":false,info":{"bitrate":null,"height":720,"framesPerSecond":null}},{"name":"live.mpd","type":"Dash","uri":"https://pcast.phenixrts.com/video/application-id/us-central#us-central1-c.YfMSNkZM.20171121.9VuaQSac/live.mpd","isPrimary":true,"isVariant":true,"isProtected":false,"info":{"bitrate":null,"height":null,"framesPerSecond":null}},...],"streamInfo":{"startTime":"2017-11-21T20:53:43.529000000Z","endTime":"2017-11-21T20:53:40.955000000Z"}}
cURL
1{
2 "status" : "ok",
3 "playlists" : [
4 {
5 "name" : "live-720.mpd",
6 "type" : "Dash",
7 "uri" : "https://pcast.phenixrts.com/video/application-id/us-central#us-central1-c.YfMSNkZM.20171121.9VuaQSac/live-720.mpd",
8 "isPrimary": false,
9 "isVariant" : false,
10 "isProtected" : false,
11 "isEncrypted" : false,
12 "info" : {
13 "bitrate" : null,
14 "height" : 720,
15 "framesPerSecond" : null
16 }
17 },
18 {
19 "name" : "live.mpd",
20 "type" : "Dash",
21 "uri" : "https://pcast.phenixrts.com/video/application-id/us-central#us-central1-c.YfMSNkZM.20171121.9VuaQSac/live.mpd",
22 "isPrimary": false,
23 "isVariant": true
24 "isProtected" : false,
25 "isEncrypted" : false,
26 "info" : {
27 "bitrate" : null
28 "height" : null,
29 "framesPerSecond" : null
30 }
31 },
32 ...
33 ],
34 "streamInfo" : {
35 "startTime" : "2017-11-21T20:53:43.529000000Z",
36 "endTime" : "2017-11-21T20:53:40.955000000Z"
37 }
38}

Playlist API Status Codes

HTTPStatusRetryDescription
200 OKokneverPlaylists were successfully retrieved.
400 Bad RequestvariesneverIndicates an issue with the request.
401 UnauthorizedunauthorizedneverThe streaming platform was not able to authorize the provided credentials.
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.
5XXvariesonce immediately, then exponential backoffA transient server error.

Playlist API Response fields

FieldDescription
statusSee Status Codes
playlistsArray of playlists. See Playlist fields.
streamInfoMetadata about the stream. See Stream Metadata fields.

Playlist fields

FieldDescription
nameName of the playlist
typetype of playlist - HLS or DASH
uriURI of the playlist
isPrimaryWhether this is a primary playlist containing variant playlists
isVariantWhether this is a variant playlist (Note: This flag is currently wrong. Use isPrimary until it is fixed.)
isProtectedWhether this playlist is protected with an edge auth token. See token-auth.
isEncryptedWhether this playlist is encrypted with DRM
infoMetadata about the playlist. See Playlist metadata.

Playlist metadata

FieldDescription
bitratebit rate of track(s) in the playlist. This is null when the bitrate is unknown or when there are tracks with different bitrates.
heightheight of the track(s) in the playlist. This is null when the height is unknown or when there are tracks with different height.
framesPerSecondframes per second (fps) of the track(s) in the playlist. This is null when the framesPerSecond value is unknown or when there are tracks with different frames per second.

Stream Metadata fields

FieldDescription
startTimeRFC 3339 compliant start time of the stream
endTimeRFC 3339 compliant end time of the stream. This is null if the stream has not ended.

Accessing playlists

Accessing Playlists Request

Send a GET request to the /video/<applicationId>/<urlEncodedStreamId>/<manifest> endpoint as shown:

HTTP
1GET /video/<applicationId>/<urlEncodedStreamId>/<manifest> HTTP/1.1
2Host: pcast.phenixrts.com
3Accept: */*
cURL
1$ curl https://pcast.phenixrts.com/video/<applicationId>/<urlEncodedStreamId>/<manifest> \
2-H "Accept: */*" \
3-X GET
Encoding: Stream ID may contain characters that are unsafe for URLs. Be sure to encode the StreamId in the URL path. For example, the URL encoding of `us-central#us-central` is `us-central%23us-central`

Request URI Parameters

ParameterDescription
streamToken (optional)Streams protected with token-auth require a valid edge auth token to be provided. An edge auth token issued for the channel ID or alias will grant access to the playlist for the channel. Alternatively, if the origin stream ID is known, access can be restricted to just a stream itself.

Playlist API Status Codes

HTTPStatusRetryDescription
200 OKokneverPlaylists were successfully retrieved.
400 Bad RequestvariesneverIndicates an issue with the request.
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.
Page Content
    Copyright 2023 © Phenix RTS
    Privacy Policy | Terms of Service
    v2023-01-31T21:25:10