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.
DELETE /pcast/stream/archive HTTP/1.1
Host: pcast.phenixrts.com
Accept: application/json
Content-Type: application/json
Content-Length: 124
{
"applicationId": "<applicationId>",
"secret": "<secret>",
"streamId": "<streamId>",
"reason": "<reason>"
}
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
Field | Description |
---|---|
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/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 15
{"status":"ok"}
Status Codes
HTTP | Status | Retry | Description |
---|---|---|---|
200 OK | ok | never | Stream was successfully terminated. |
400 Bad Request | varies | never | Indicates an issue with the request itself. |
401 Unauthorized | unauthorized | never | The streaming platform was not able to authorize the provided credentials. |
404 Not Found | not-found | never | The specified stream is not known to the platform. |
408 Request Timeout | request-timeout | once immediately, then exponential backoff | Request timed out likely due to temporary resource or network conditions. Please try again. |
409 Conflict | not-ended | after terminating the stream | Stream 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 Gone | already-deleted | never | The specified stream has already been deleted. |
410 Gone | resource-unavailable | never | The resources that hosted the specified stream are unavailable. |
4XX | varies | never | Indicates an issue with the request itself. |
503 Service Unavailable | capacity | once | The system is temporarily overloaded. Please try again later. |
5XX | varies | once immediately, then exponential backoff | A 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:
PUT /pcast/stream/playlist HTTP/1.1
Host: pcast.phenixrts.com
Accept: application/json
Content-Type: application/json
Content-Length: 98
{
"applicationId": "<applicationId>",
"secret": "<secret>",
"streamId": "<streamId>"
}
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
Field | Description |
---|---|
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/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 698
{"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"}}
Playlist API Status Codes
HTTP | Status | Retry | Description |
---|---|---|---|
200 OK | ok | never | Playlists were successfully retrieved. |
400 Bad Request | varies | never | Indicates an issue with the request. |
401 Unauthorized | unauthorized | never | The streaming platform was not able to authorize the provided credentials. |
405 Not Supported | not-supported | never | Playlists are not available for the stream. |
408 Request Timeout | request-timeout | once immediately, then exponential backoff | Request timed out likely due to temporary resource or network conditions. Please try again. |
4XX | varies | never | Indicates an issue with the request. |
503 Service Unavailable | capacity | once | The system is temporarily overloaded. Please try again later. |
5XX | varies | once immediately, then exponential backoff | A transient server error. |
Playlist API Response fields
Field | Description |
---|---|
status | See Status Codes |
playlists | Array of playlists. See Playlist fields. |
streamInfo | Metadata about the stream. See Stream Metadata fields. |
Playlist fields
Field | Description |
---|---|
name | Name of the playlist |
type | type of playlist - HLS or DASH |
uri | URI of the playlist |
isPrimary | Whether this is a primary playlist containing variant playlists |
isVariant | Whether this is a variant playlist (Note: This flag is currently wrong. Use isPrimary until it is fixed.) |
isProtected | Whether this playlist is protected with an edge auth token. See token-auth . |
isEncrypted | Whether this playlist is encrypted with DRM |
info | Metadata about the playlist. See Playlist metadata. |
Playlist metadata
Field | Description |
---|---|
bitrate | bit rate of track(s) in the playlist. This is null when the bitrate is unknown or when there are tracks with different bitrates. |
height | height of the track(s) in the playlist. This is null when the height is unknown or when there are tracks with different height. |
framesPerSecond | frames 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
Field | Description |
---|---|
startTime | RFC 3339 compliant start time of the stream |
endTime | RFC 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:
GET /video/<applicationId>/<urlEncodedStreamId>/<manifest> HTTP/1.1
Host: pcast.phenixrts.com
Accept: */*
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
Parameter | Description |
---|---|
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
HTTP | Status | Retry | Description |
---|---|---|---|
200 OK | ok | never | Playlists were successfully retrieved. |
400 Bad Request | varies | never | Indicates an issue with the request. |
401 Unauthorized | unauthorized | never | The streaming platform was not able to authorize the provided credentials. |
4XX | varies | never | Indicates an issue with the request. |
503 Service Unavailable | capacity | once | The system is temporarily overloaded. Please try again later. |
5XX | varies | once immediately, then exponential backoff | A transient server error. |