The BoxCast API exists to provide partners and broadcasters with programmatic access to BoxCast's services, including scheduling broadcasts, embedding video players, consuming view statistics, etc. In general, anything that a broadcaster can accomplish through the BoxCast web dashboard can be accomplished directly through the API.
API requests must be encrypted via TLS/SSL. Unencrypted requests will be rejected.
All resources are accessed relative to the API base URL:
https://rest.boxcast.com/
The BoxCast API conforms to a standard HTTP REST pattern. It is organized as a set of resources that can be created, read, updated, deleted, listed and/or searched through HTTP requests. In general, snake_case is used for all resource names, parameters, field names and tokens.
In order to avoid common client bugs, the API also avoids the use of null and never omits unused fields from a response. Instead, meaningful values are returned, such as an empty string (""
) or a far-future datetime ("9999-12-31T23:59:59Z"
) as appropriate.
The following typical patterns are used for resource requests:
HTTP Request Pattern | Description |
---|---|
for a resource collection | |
POST /resources | Create a new resource from the posted parameters. |
GET /resources/id | Read detailed information about the identified resource. |
PUT /resources/id | Update the identified resource from the posted parameters. |
DELETE /resources/id | Delete the identified resource. |
GET /resources | Search and list resource summaries. |
for a singleton | |
GET /resource | Read detailed information about the singleton resource. |
PUT /resource | Update the singleton resource from the posted parameters. |
The BoxCast API handles authentication in conformance with the OAuth2 protocol (RFC 6749 ). One of the OAuth2 grant types are used to acquire an access token. Once the API client has a valid access token, subsequent authenticated requests can be made by supplying the access token in the HTTP Authorization header as a bearer token (RFC 6750 ).
https://auth.boxcast.com/oauth2/auth
https://auth.boxcast.com/oauth2/token
All API clients must be registered before use. Please contact BoxCast customer support to register an API client application and receive valid API client credentials.
Parameter | Type | Description | Remarks |
---|---|---|---|
client_id | slug | The API client's primary unique identifier. | Required. |
client_secret | text | The API client's secure password. This must be kept secure at all times. | Required. |
This type of grant allows BoxCast accounts to programmatically access their own information. For example, a production company may wish to schedule BoxCast broadcasts on their own account as part of their own product. This type of grant is not suitable for a 3rd-party application to access another BoxCast account.
An API client authenticates by directly supplying their API token credentials (not a particular user's email and password) in exchange for an access token.
POST https://auth.boxcast.com/oauth2/token
Authorization: Basic {base-64 encoded client_id:client_secret}
Parameter | Type | Description | Remarks |
---|---|---|---|
grant_type | token | Must be "client_credentials" . | Required. |
scope | slug | A space-separated list of scopes that the client will need to access. | Optional. If not provided, the returned scope will match the scope of the API key. |
Response Field | Type | Description |
---|---|---|
token_type | token | Always "bearer" . |
access_token | slug | The bearer token to make authenticated requests. |
expires_in | numeric | The number of seconds of inactivity before the token expires. |
scope | slug | A space-separated list of scopes that the client has been granted permission to access. |
The API client can now make authenticated requests to the API.
If you're ready, jump to a code sample.
If the API client credentials are client_id=4pQPM2O6hK
and client_secret=1oqZV~7.vw
(and noting that the base-64 encoding of 4pQPM2O6hK:1oqZV~7.vw
is NHBRUE0yTzZoSzoxb3FaVn43LnZ3
), then:
grant_type=client_credentials
{ "token_type": "bearer", "access_token": "iq50kw1GmZ5T54PJOVpsvb5merQUwU3IT5f-Xtrxj~6jgBnwF9yCGg~zySOZ4U_ovm5wsvJkhphnDMrg", "expires_in": 86400, "scope": "owner" }
If you are using Client Credentials, you can skip ahead
This type of grant allows BoxCast accounts to be safely integrated into 3rd-party web applications. For example, a website hosting company may want to allow BoxCast customers to integrate their broadcasts into their website without needing to go to the BoxCast dashboard or cut-and-paste any codes. This type of grant makes that possible, while keeping the user's BoxCast account independent from their 3rd-party (e.g. website hosting) account.
An API client authenticates by redirecting a user to BoxCast, which allows the user to login and grant access to the API client. Once the user has granted access, they are redirected to the API client's redirection endpoint (setup during registration) along with a one-time authorization code. The API client can then send this code securely to the BoxCast API in exchange for an access token.
https://auth.boxcast.com/oauth2/auth?response_type=code&client_id={client_id}&redirect_uri={redirect_uri}&scope={scope}&state={state}
Parameter | Type | Description | Remarks |
---|---|---|---|
response_type | token | Must be "code" . | Required. |
client_id | slug | The API client's unique identifier. | Required. |
redirect_uri | slug | The client's redirection endpoint to which the authorization response will be redirected. | Required. |
scope | slug | A space-separated list of scopes that the client will ask the user for permission to access. | Required. |
state | slug | An opaque random value (at least 8 characters) used to maintain state between the request and callback. It should be used for preventing cross-site request forgery. | Required. |
<html>...omitted...<html>
This is all handled on the BoxCast site.
After authenticating the user's credentials and verifying permissions, the user is redirected back to the API client via a secure callback URI that was set during client registration. The authorization response redirects to this callback with the response parameters in the query string.
302 Found Location: {callback_uri}?code={code}&state={state}
Response Field | Type | Description |
---|---|---|
code | slug | A one-time use authorization code which can be securely exchanged for an access token. |
state | slug | The exact same value that was passed in the initial request. API clients should use this to match callbacks to requests and reject any callbacks that are not matched. |
NOTE: If there is a problem, then the callback URI will not receive an authorization code, but error fields instead.
In response, the API client should securely post this authorization code back to the token endpoint in exchange for an access token.
POST https://auth.boxcast.com/oauth2/token
Authorization: Basic {base-64 encoded client_id:client_secret}
Parameter | Type | Description | Remarks |
---|---|---|---|
grant_type | token | Must be "authorization_code" . | Required. |
code | slug | The one-time authorization code returned from the authorization endpoint. | Required. |
redirect_uri | slug | The same redirect_uri which was used during the initial request in Step 1. | Required. |
Response Field | Type | Description |
---|---|---|
token_type | token | Always "bearer" . |
access_token | slug | The bearer token to make authenticated requests. |
expires_in | numeric | The number of seconds of inactivity before the token expires. |
refresh_token (if applicable) | slug | A long-lived refresh token suitable for saving securely and using to get a new access token later without require the user to login again. |
scope | slug | A space-separated list of scopes that the client has been granted permission to access. |
The API client can now make authenticated requests to the API.
If you're ready, jump to a code sample.
If the API client credentials are client_id=4pQPM2O6hK
and client_secret=1oqZV~7.vw
(and noting that the base-64 encoding of 4pQPM2O6hK:1oqZV~7.vw
is NHBRUE0yTzZoSzoxb3FaVn43LnZ3
), then:
grant_type=authorization_code&code=bDEUJZy~ISjJMlkbf.Zfks~HbDU8a0CaiQeOQyCo.QOv1HeRIW8CkFuN7dm4zYuVfw7jRfNNp~~LKClm&redirect_uri=https%3A%2F%2Fexample.com%2Foauth2-callback
{ "token_type": "bearer", "access_token": "iq50kw1GmZ5T54PJOVpsvb5merQUwU3IT5f-Xtrxj~6jgBnwF9yCGg~zySOZ4U_ovm5wsvJkhphnDMrg", "expires_in": 86400, "refresh_token": "JMjZml6S19qxWp0Jb9Pe4NG5cDTT8nlhzxOp08ajhVKZJViCW5YUj_pXutaUYIEXo9wT7Ei3yf62D-EB", "scope": "owner" }
If the client is unable to securely store the client credentials, such as a mobile application, then the client will not be issued a secret, but must use Proof Key for Code Exchange (PKCE).
This should be handled by a secure implementation, such as AppAuth.
Once the API client has acquired an access token, it can make authenticated requests by passing it in the HTTP Authorization header as a bearer token (RFC 6750 ).
{ ...omitted... }
An access token will expire after a certain period of time. Once the token expires, it is no longer valid; any attempt to use an expired token will result in an unauthorized error.
If the client has a refresh token, it can request a new access token without requiring a user to login again.
An API client authenticates by supplying the refresh token (which has a much longer amount of time before expiration) in exchange for an access token.
POST https://auth.boxcast.com/oauth2/token
Authorization: Basic {base-64 encoded client_id:client_secret}
Parameter | Type | Description | Remarks |
---|---|---|---|
grant_type | token | Must be "refresh_token" . | Required. |
refresh_token | slug | The refresh token which was saved securely after the initial authentication. |
Response Field | Type | Description |
---|---|---|
token_type | token | Always "bearer" . |
access_token | slug | The bearer token to make authenticated requests. |
expires_in | numeric | The number of seconds of inactivity before the token expires. |
refresh_token | slug | A long-lived refresh token suitable for saving securely and using to get a new access token later without require the user to login again. |
scope | slug | A space-separated list of scopes that the client has been granted permission to access. |
The API client can now make authenticated requests to the API.
When a client requests access, the user is able to grant or allow the client to access various aspects of their account. These are defined by scopes which the client requests access to and which the user is prompted to grant access.
Scope | Description |
---|---|
offline | Allows the client to store and use a refresh token. |
owner | Allows access to all areas of the account. |
Data types are used by the API to validate parameters and to define possible values that a resource field may take. The following types are used:
Type | Description | Examples |
---|---|---|
boolean | A simple true or false indicator. | ,
|
numeric | A simple number. Numeric fields may be integers, floating-point decimals, or negative numbers. A field or parameter using a numeric type may contain additional restrictions about which numbers are considered valid. | , ,
|
text | An open text field which can contain any printable characters including newlines and whitespace. | "Lorem ipsum dolor sit amet... \n |
string | A single-line of text with no whitespace on either end. All printable characters are valid. | , ,
|
datetime | An ISO 8601 formatted date/time string in UTC time. | , ,
|
slug | A string which consists only of URL-safe characters (A -Z , a -z , 0 -9 , - , _ , . , and ~ ). |
, ,
|
token | A slug which belongs to a set of possible values and has a particular meaning. Any field or parameter using a token will provide a list of possible values along with their meanings. Any value outside of the defined list is considered invalid. | See BoxCaster status. |
token+ | A token for which the set of possible values is open-ended. More values can be added to the list without changing the API version, therefore API clients are not guaranteed that the token will be from the list defined at the time that they last read the API documentation. Unknown token values must therefore be handled in a graceful way. Suggestions are provided with the specific documentation for each resource. | See BoxCaster warning. |
array | An array of objects. The expected type for each item's value is given in the resource field description. | , ,
|
map | A map (or hash) of key-value pairs. Expected types for the map's keys and values are given in the resource field description, although each key is generally a token type. | , ,
|
GET requests should pass all parameters in the URL query string.
POST and PUT requests should post all parameters in the request body using a recognized format indicated by the Content-type header. The currently supported content types for posting parameters are:
Content-type: application/x-www-form-urlencoded
Content-type: application/json
The current API version is v1 and the only currently supported representation is JSON. These are (and will remain) the default settings.
In order to minimize API version changes, users of the API must ignore any unknown fields that are returned and handle unknown tokens gracefully (as described in each resource's reference documentation for token+ fields). When new features are added to the API, the version number will only change if the updated API would cause an existing, well-behaved client to function incorrectly.
As they become available, alternate API versions and representations can be selected using the HTTP Accept header. The currently recognized versions are:
Accept: application/vnd.boxcast-v1+json
The BoxCast API may respond to any request with an HTTP redirect. An API client must follow such redirects according to the HTTP 1.1 spec by retrying the request at the URL given in the Location header. Typically, redirects will be:
HTTP Status | Description |
---|---|
301 | The resource has been permanently moved. Future requests should be made to the new URL. |
302 , 307 | The resource has been temporarily moved. This request should be retried at the new URL, but future requests should continue to use the old URL. |
304 | The resource has not been modified. The API client should not retry the request, but should rely on its cached copy. |
The BoxCast API supports conditional GET requests using the HTTP headers: ETag
and If-None-Match
. If an API client makes a GET request, it may use the returned ETag header to make subsequent conditional GET requests for the same resource by supplying the ETag in the If-None-Match header. If the resource has not changed, the API will return a status of 304 (Not Modified).
Some resource (as noted) support conditional PUT requests using the HTTP headers: ETag
and If-Match
. If an API client makes a GET request, it may use the returned ETag header to make subsequent conditional PUT requests for the same resource by supplying the ETag in the If-Match header. If the resource has not changed, the API will modify the resource as requested. However, if the resource has changed, the update will fail with a status of 412 (Precondition Failed). This is very useful for making sensitive updates to avoid conflicting changes that would be unwanted.
API requests which search and list summaries from a resource collection are subject to pagination if there are too many results.
If a result list is paginated, the response will include an HTTP X-Pagination header, which is a JSON-encoded object that may contain the following:
Key | Description | Example |
---|---|---|
first | The page number of the first page of results. |
|
previous | The page number of the previous page of results. |
|
next | The page number of the next page of results. |
|
last | The page number of the last page of results. |
|
total | The total count of results. |
|
When querying a paginated resource, the following request parameters can be provided as querystring arguments to control pagination behavior:
Parameter | Description | Example |
---|---|---|
p | The page number to query (0-based index). | p=2 |
l | The page size limit. | l=20 |
s | The sort order of the results. | s=-starts_at |
[ ...omitted... ]
API requests against a resource collection support a filter syntax for exact matching of certain fields. Some fields support single values, while others may support a list of one or more values.
Filter parameters should be provided in the querystring; filter keys start with filter.
, and are followed by the key name. For example, filtering a set of resources by broadcast ID b123
would look like filter.broadcast_id=b123
. For filters that accept multiple values, the values should be a comma-separated list with no whitespace; for example: filter.ids=b123,b456
.
API requests against a resource collection support a text query syntax to narrow down and better filter results. The search is initiated by providing a string as the q
querystring parameter.
The search grammar supports several types of instructions.
Type | Description | Example |
---|---|---|
Wildcard | Find partial word matches. | *football* |
Exact Match | Find an exact quoted string. | "St. Joseph" |
Field-Scoped | Search against a single field rather than all. Note that not all fields in a resource support searching against. | timeframe:current |
Date Range | Filter within a given set of dates. | starts_at:[2015-01-01T00:00:00 TO 2015-01-02T00:00:00] |
Combination (OR) | Space-separated phrases are considered boolean OR. | timeframe:past timeframe:current |
Combination (AND) | Phrases prefixed with a + are boolean AND. |
football +timeframe:current |
Please note that if you attempt to apply a field-scoped search to a field that does not support searching, the API will return an error.
When an error occurs, the API will generally return a meaningful HTTP error code along with following error fields:
Field | Type | Description |
---|---|---|
error | token+ | The type of error condition that occurred. Possible values are:
|
error_description | string | A human-friendly description of the error condition. |
invalid_fields | map | A map from field/parameter names (token+) to error descriptions (string), which provides more specific details about invalid fields or parameters. |
{ "name": "" }
{ "error": "unprocessable_entity", "error_description": "The request could not be processed.", "invalid_fields": { "name": "can't be blank" } }
An account represents a person or organization that uses BoxCast services. Each account has its own boxcasters, broadcasts, users, etc. which are managed through the account and are not accessible from any other account. An account is the entity which is responsible for paying invoices or receiving profits from ticket sales.
Field | Type | Description |
---|---|---|
id | slug | The primary unique identifier. |
name | string | A human-friendly name for quick identification and display in user interfaces. |
channel_id | slug | An automatically created channel for all non-private broadcasts that have streamed, are streaming or will stream from the account. |
description | text | A description of the account which is show to viewers. This text identifies and describes the organization that is providing broadcasts. |
time_zone | string | The primary time zone in which the organization is based. |
static_playlist_url | string |
An M3U8 URL containing any currently-live, public broadcasts from this account.
NOTE: This M3U8 URL will return a 404 if there is no currently-live, public content.
NOTE: This URL can be used for integration into certain third party app providers. It should never be distributed directly to viewers. Also be aware that the use of this URL for watching the broadcast will skew your analytics. If you would like to retain analytics, your app should be updated to use one of the supported BoxCast SDKs.
|
Returns all fields for the current account.
GET /account
{ "id": "MTVUYQLN", "name": "The Ocho", "channel_id": "3nRUBPr00vqUSYYKfBtX", "description": "The obscure sports network.", "time_zone": "Pacific Time (US & Canada)", "static_playlist_url": ""https://play.boxcast.com/p/MTVUYQLN/v/all-ext.m3u8?signed=yes" }
A BoxCaster is a device that captures, encodes, and transmits an audio/video stream to the BoxCast service over a network.
Field | Type | Description |
---|---|---|
id | slug | The primary unique identifier. Usually, this ID is printed on the underside of the BoxCaster device. |
name | string | A human-friendly name for quick identification and display in user interfaces. |
status | token | An indicator of the current state of the BoxCaster:
|
warning | token+ | An indicator of any warning condition that the BoxCaster has detected:
|
last_seen_at | datetime | The last time at which the BoxCaster reported to the BoxCast service. This is helpful information when the BoxCaster is offline. |
next_broadcast_at | datetime | The start time of the next broadcast that the BoxCaster will need to stream (or of the currently streaming broadcast). This is helpful information when the BoxCaster has an unexpected status, such as being offline during a scheduled broadcast. If there is no upcoming broadcast scheduled on the BoxCaster, then this field will show a far-future date (e.g., 9999-12-31T23:59:59Z). |
next_broadcast_id | slug | The ID of the next broadcast that the BoxCaster will need to stream (or of the currently streaming broadcast). If there is no upcoming broadcast scheduled on the BoxCaster, then this field will be blank. |
next_broadcast_name | string | The name of the next broadcast that the BoxCaster will need to stream (or of the currently streaming broadcast). If there is no upcoming broadcast scheduled on the BoxCaster, then this field will be blank. |
the following fields are excluded from summary responses | ||
channel_id | slug | An automatically created channel for all non-private broadcasts that have streamed, are streaming or will stream through the BoxCaster. |
static_playlist_url | string |
An M3U8 URL containing any currently-live, public broadcasts from this BoxCaster.
NOTE: This M3U8 URL will return a 404 if there is no currently-live, public content.
NOTE: This URL can be used for integration into certain third party app providers. It should never be distributed directly to viewers. Also be aware that the use of this URL for watching the broadcast will skew your analytics. If you would like to retain analytics, your app should be updated to use one of the supported BoxCast SDKs.
|
Returns all fields for the specified BoxCaster.
GET /account/boxcasters/{id}
{ "id": "m9c4ebfb82112", "name": "Main Camera", "status": "broadcasting", "warning": "none", "last_seen_at": "2012-10-09T15:44:09Z", "next_broadcast_at": "2012-10-09T15:00:00Z", "next_broadcast_id": "e3u2Te__7aaAqUNkjvpj", "next_broadcast_name": "Smith Wedding 10/9/12", "channel_id": "dSUdyxXH1loPJYIlR4F0", "static_playlist_url": ""https://play.boxcast.com/p/dSUdyxXH1loPJYIlR4F0/v/all-ext.m3u8?signed=yes" }
Updates the supplied fields of the specified BoxCaster.
PUT /account/boxcasters/{id}
Parameter | Type | Description | Remarks |
---|---|---|---|
name | string | The desired name for the BoxCaster. | Optional. |
{ "name": "New Name" }
{ "id": "m9c4ebfb82112", "name": "New Name", "status": "broadcasting", "warning": "none", "last_seen_at": "2012-10-09T15:44:09Z", "next_broadcast_at": "2012-10-09T15:00:00Z", "next_broadcast_id": "e3u2Te__7aaAqUNkjvpj", "next_broadcast_name": "Smith Wedding 10/9/12", "channel_id": "dSUdyxXH1loPJYIlR4F0", "static_playlist_url": ""https://play.boxcast.com/p/dSUdyxXH1loPJYIlR4F0/v/all-ext.m3u8?signed=yes" }
Returns summary fields for all BoxCasters on the current account.
GET /account/boxcasters
Valid filters:
filter.ids
: List of BoxCaster IDsfilter.warning
: BoxCaster warning statusValid queries:
id
: BoxCaster IDname
: BoxCaster nameValid sorts:
id
: BoxCaster IDname
: BoxCaster name[ { "id": "m9c4ebfb82112", "name": "Main Camera", "status": "broadcasting", "warning": "none", "last_seen_at": "2012-10-09T15:44:09Z", "next_broadcast_at": "2012-10-09T15:00:00Z", "next_broadcast_id": "e3u2Te__7aaAqUNkjvpj", "next_broadcast_name": "Smith Wedding 10/9/12" }, { "id": "m9c4ebf96d67a", "name": "Mobile Camera", "status": "ready", "warning": "updating_firmware", "last_seen_at": "2012-10-09T15:44:17Z", "next_broadcast_at": "2012-10-21T10:30:00Z", "next_broadcast_id": "wiY7AZb5oA1U52u0mX8k", "next_broadcast_name": "First Service" } ]
[ { "id": "m9c4ebf96d67a", "name": "Mobile Camera", "status": "ready", "warning": "updating_firmware", "last_seen_at": "2012-10-09T15:44:17Z", "next_broadcast_at": "2012-10-21T10:30:00Z", "next_broadcast_id": "wiY7AZb5oA1U52u0mX8k", "next_broadcast_name": "First Service" }, { "id": "m9c4ebfb82112", "name": "Main Camera", "status": "broadcasting", "warning": "none", "last_seen_at": "2012-10-09T15:44:09Z", "next_broadcast_at": "2012-10-09T15:00:00Z", "next_broadcast_id": "e3u2Te__7aaAqUNkjvpj", "next_broadcast_name": "Smith Wedding 10/9/12" } ]
A broadcast represents a single audio/video stream with a name, description and start/stop times. A broadcast is always streamed through a specific BoxCaster, and it may have a live stream or recording associated with it or it may be a mere placeholder (i.e. if it is scheduled to start in the future).
Field | Type | Description |
---|---|---|
id | slug | The primary unique identifier. |
name | string | A human-friendly name for quick identification and display in user interfaces. |
channel_id | slug | An automatically created channel which consists only of this broadcast (even if the broadcast is private). |
preview | string | A URL to a thumbnail image for the broadcast, if available. |
poster | string | A URL to a full-size poster image for the broadcast, if available. |
stream_source | token | The source of the audio and video for the broadcast:
|
boxcaster_id | slug | The id of the BoxCaster that streamed or will stream the broadcast. Empty if stream_source is not boxcaster. |
boxcaster_name | string | The name of the BoxCaster that streamed or will stream the broadcast. Empty if stream_source is not boxcaster. |
audio_source | token | The audio source the BoxCaster will use when streaming:
|
starts_at | datetime | The scheduled start time for the broadcast. |
stops_at | datetime | The scheduled stop time for the broadcast. |
timeframe | token | An indicator of the timeframe in which this broadcast is scheduled to stream:
|
is_private | boolean | A public broadcast may be listed and promoted by BoxCast so that a public viewer can find it easily. If a broadcast is private, however, then BoxCast will generate an obfuscated channel for the broadcast and will not promote it or list it in any channels (except for its own channel). This is useful, for example, when creating a test broadcast. |
is_ticketed | boolean | A ticketed broadcast requires a ticket purchase to view the full stream. Some ticketed broadcasts offer a variant stream which is viewable without a ticket purchase (so-called "flex" broadcasts). |
ticket_price | numeric | The purchase price in USD for a ticket to view the highest quality version of the broadcast. All values are rounded to two decimal places. |
free_variant | token+ | A variant of the broadcast which may be viewed without purchasing a ticket:
|
viewer_url | string | The URL at which BoxCast hosts a web page for viewers to watch the broadcast live or recorded. |
total_view_count | numeric | The total number of times this broadcast was watched. |
total_minutes_viewed | numeric | The total duration in minutes that this broadcast was watched, across all views. |
total_active_viewer_count | numeric | The total number of currently active viewers of this broadcast. |
the following fields are excluded from summary responses | ||
description | text | Additional information to display to viewers about the broadcast. |
in_channel_ids | array of strings | The IDs of any additional Channels the broadcast has been added to. |
static_playlist_url | string |
An M3U8 URL that can always be used to play this broadcast.
NOTE: This URL can be used for integration into certain third party app providers. It should never be distributed directly to viewers. Also be aware that the use of this URL for watching the broadcast will skew your analytics. If you would like to retain analytics, your app should be updated to use one of the supported BoxCast SDKs.
|
Creates a new scheduled broadcast from the supplied fields.
POST /account/broadcasts
Parameter | Type | Description | Remarks |
---|---|---|---|
name | string | The desired name for the broadcast. | Required. |
stream_source | slug | The source of the audio and video for the broadcast. Typically this is boxcaster . | Required. |
boxcaster_id | slug | The id of the BoxCaster that will stream this broadcast. | Required if stream_source is boxcaster . |
audio_source | token | The audio_source the BoxCaster will use when streaming. | Optional |
static_rtmp_id | slug | The id of the RTMP source that will stream this broadcast. | Required if stream_source is rtmp . |
starts_at | datetime | The desired starts_at for the broadcast. | Required; can't be in the past. The keyword now may also be used instead of a datetime to start the broadcast as soon as possible. |
stops_at | datetime | The desired stops_at for the broadcast. | Optional; must be after starts_at. The keyword now may also be used instead of a datetime to stop the broadcast as soon as possible. |
is_private | boolean | Whether or not the broadcast should be private. | Optional. |
is_ticketed | boolean | Whether or not the broadcast should be ticketed. | Optional. |
ticket_price | numeric | The desired ticket_price for the broadcast (ignored if not ticketed). | Optional. |
free_variant | token+ | The desired free_variant for the broadcast (ignored if not ticketed). | Optional. |
description | text | The desired description for the broadcast. | Optional. |
in_channel_ids | array of strings | The desired list of Channel IDs for the broadcast. | Optional. |
target_video_resolution | numeric | The desired target video resolution for the broadcast. Note: This is just a target and the actual video resolution could differ based on source, account limitations, etc. | Optional. For best results use 1080 , 720 or 480 |
{ "name": "Celtics vs Knicks", "stream_source": "boxcaster", "boxcaster_id": "n9c4ebf123456", "starts_at": "2013-04-28T23:00:00Z", "stops_at": "2013-04-29T02:00:00Z" }
{ "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "Celtics vs Knicks", "channel_id": "celtics-vs-knicks", "stream_source": "boxcaster", "boxcaster_id": "n9c4ebf123456", "boxcaster_name": "Main Camera", "starts_at": "2013-04-28T23:00:00Z", "stops_at": "2013-04-29T02:00:00Z", "timeframe": "future", "is_private": false, "is_ticketed": false, "ticket_price": 0, "free_variant": "best", "viewer_url": "https://www.boxcast.com/show/#/celtics-vs-knicks", "description": "", "in_channel_ids": [], "static_playlist_url": ""https://play.boxcast.com/p/Z7a0XjcgnYpUIuKqvxGk/v/all-ext.m3u8?signed=yes" }
Returns all fields for the specified broadcast.
GET /account/broadcasts/{id}
{ "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "Celtics vs Knicks", "channel_id": "celtics-vs-knicks", "boxcaster_id": "m9c4ebfb82112", "boxcaster_name": "Main Camera", "starts_at": "2013-04-28T23:00:00Z", "stops_at": "2013-04-29T02:00:00Z", "timeframe": "future", "is_private": false, "is_ticketed": true, "ticket_price": 5.95, "free_variant": "low", "viewer_url": "https://www.boxcast.com/show/#/celtics-vs-knicks", "description": "Lorem ipsum dolor sit...", "in_channel_ids": [], "static_playlist_url": ""https://play.boxcast.com/p/Z7a0XjcgnYpUIuKqvxGk/v/all-ext.m3u8?signed=yes" }
Updates the supplied fields of the specified broadcast.
PUT /account/broadcasts/{id}
Parameter | Type | Description | Remarks |
---|---|---|---|
name | string | The desired name for the broadcast. | Optional. |
boxcaster_id | slug | The id of the BoxCaster that will stream this broadcast. | Optional. |
audio_source | token | The audio_source the BoxCaster will use when streaming. | Optional |
starts_at | datetime | The desired starts_at for the broadcast. | Optional; can't be in the past. |
stops_at | datetime | The desired stops_at for the broadcast. | Optional; must be after starts_at. |
is_private | boolean | Whether or not the broadcast should be private. | Optional. |
is_ticketed | boolean | Whether or not the broadcast should be ticketed. | Optional. |
ticket_price | numeric | The desired ticket_price for the broadcast (ignored if not ticketed). | Optional. |
free_variant | token+ | The desired free_variant for the broadcast (ignored if not ticketed). | Optional. |
description | text | The desired description for the broadcast. | Optional. |
in_channel_ids | array of strings | The desired list of Channel IDs for the broadcast. | Optional. |
{ "name": "The Big Game", "description": "This is a really big deal." }
{ "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "The Big Game", "channel_id": "celtics-vs-knicks", "boxcaster_id": "m9c4ebfb82112", "boxcaster_name": "Main Camera", "starts_at": "2013-04-28T23:00:00Z", "stops_at": "2013-04-29T02:00:00Z", "timeframe": "future", "is_private": false, "is_ticketed": true, "ticket_price": 5.95, "free_variant": "low", "viewer_url": "https://www.boxcast.com/show/#/celtics-vs-knicks", "description": "This is a really big deal.", "in_channel_ids": [], "static_playlist_url": ""https://play.boxcast.com/p/Z7a0XjcgnYpUIuKqvxGk/v/all-ext.m3u8?signed=yes" }
Returns summary fields for all broadcasts on the current account. Please be aware that the results may be paginated.
GET /account/broadcasts
Parameter | Type | Description | Remarks |
---|---|---|---|
q | string | Search query. | Optional. |
p | string | Page number. | Optional. |
l | string | Page size limit. | Optional. |
s | token | Sort order. | Optional. |
Valid filters:
filter.ids
: List of Broadcast IDsfilter.stream_source
: Stream Source (e.g. boxcaster
, rtmp
, app
, etc.)filter.stream_sources
: List of Stream Sources (e.g. boxcaster
, rtmp
, app
, etc.)filter.private
: Filter for private (true
) or public (false
) broadcasts.filter.free_variant
: Filter to find flex ticketed broadcasts (none
, best
, low
)filter.ticketed
: Filter to find ticketed broadcastsfilter.has_recording
: Filter to find only broadcasts with a valid recording. (true
, false
)filter.audio_only
: Filter to find only broadcasts that are or are not audio only. (true
, false
)Valid queries:
id
: Broadcast IDname
: Broadcast namedescription
: Broadcast descriptionname_or_description
: Broadcast name or descriptionstarts_at
: Broadcast start time (can be a date range)stops_at
: Broadcast stop time (can be a date range)sport
: Broadcast sport (if a scoreboard overlay is configured)timeframe
: Broadcast timeframeValid sorts:
name
: Broadcast namestarts_at
: Broadcast start timestops_at
: Broadcast stop time[ { "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "Celtics vs Knicks", "channel_id": "celtics-vs-knicks", "boxcaster_id": "n9c4ebf123456", "boxcaster_name": "Main Camera", "starts_at": "2013-04-28T23:00:00Z", "stops_at": "2013-04-29T02:00:00Z", "is_private": false, "is_ticketed": false, "ticket_price": 0, "free_variant": "best", "viewer_url": "https://www.boxcast.com/show/#/celtics-vs-knicks" }, { "id": "Y9udBwPJhqZvz05xt2As", "name": "Internal Test", "channel_id": "o2Vbj5UQdNt7aq3XSW4kgRuwfyBeiG9D", "boxcaster_id": "n9c4ebf123456", "boxcaster_name": "Main Camera", "starts_at": "2013-04-28T21:00:00Z", "stops_at": "2013-04-28T21:10:00Z", "is_private": true, "is_ticketed": false, "ticket_price": 0, "free_variant": "best", "viewer_url": "https://www.boxcast.com/show/#/o2Vbj5UQdNt7aq3XSW4kgRuwfyBeiG9D" }, { "id": "x1LUy0tRVj9mXuOEWP7k", "name": "Commencement 2013", "channel_id": "commencement-2013", "boxcaster_id": "n9c4ebf123456", "boxcaster_name": "Main Camera", "starts_at": "2013-05-02T14:00:00Z", "stops_at": "2013-05-02T22:00:00Z", "is_private": false, "is_ticketed": true, "ticket_price": 5.95, "free_variant": "low", "viewer_url": "https://www.boxcast.com/show/#/commencement-2013" } ]
[ { "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "Celtics vs Knicks", "channel_id": "celtics-vs-knicks", "boxcaster_id": "n9c4ebf123456", "boxcaster_name": "Main Camera", "starts_at": "2013-04-28T23:00:00Z", "stops_at": "2013-04-29T02:00:00Z", "is_private": false, "is_ticketed": false, "ticket_price": 0, "free_variant": "best", "viewer_url": "https://www.boxcast.com/show/#/celtics-vs-knicks" } ]
Deletes a broadcast from the account.
DELETE /account/broadcasts/{id}
Downloading a broadcast as an MP4 is a multi-step process because BoxCast stores only streaming formats.
The recording must first be converted to an MP4, then a URL for download is made available. The
broadcast.recording_id
field is available as part of the
Get Broadcast Detail API call results when made with proper
Authentication.
Step 1: Prepare the download
POST /account/recordings/{broadcast.recording_id}/download
Parameter | Type | Description | Remarks |
---|---|---|---|
audio_only | boolean | Default is false (downloads as audio+video mp4, vs audio-only m4a). | Optional. |
Step 2: Poll to monitor the download status until a download_url (or audio_download_url, if audio_only was requested) is available.
GET /account/recordings/{broadcast.recording_id}
{ "id": "recording_id", "audio_download_status": "", "audio_download_url": "" "download_status": "requested|failed|processing:50|ready", "download_url": "https://...." }
A channel represents a collection of broadcasts that are related in some way. It is a way for broadcasters to group and organize their content. Channels also provide an additional monetization option by allowing broadcasters to charge for collections of content.
Field | Type | Description | Remarks |
---|---|---|---|
id | slug | The primary unique identifier. | |
name | string | The desired name for the channel. | Optional. |
description | string | The desired description for the channel. | Optional. |
is_ticketed | boolean | Whether or not the channel should be ticketed. | Optional. |
ticket_price | numeric | The desired ticket_price for the channel (ignored if not ticketed). | Optional. |
free_variant | token+ | The desired free_variant for the channel (ignored if not ticketed). | Optional. |
static_playlist_url | string |
An M3U8 URL containing any currently-live, public broadcasts from this channel.
NOTE: This M3U8 URL will return a 404 if there is no currently-live, public content.
NOTE: This URL can be used for integration into certain third party app providers. It should never be distributed directly to viewers. Also be aware that the use of this URL for watching the broadcast will skew your analytics. If you would like to retain analytics, your app should be updated to use one of the supported BoxCast SDKs.
|
Read-only. |
Creates a new channel from the supplied fields.
POST /account/channels
Parameter | Type | Description | Remarks |
---|---|---|---|
name | string | The desired name for the channel. | Required. |
description | text | The desired description for the channel. | Optional. |
is_ticketed | boolean | Whether or not the channel should be ticketed. | Optional. |
ticket_price | numeric | The desired ticket_price for the channel (ignored if not ticketed). | Optional. |
free_variant | token+ | The desired free_variant for the channel (ignored if not ticketed). | Optional. |
{ "name": "Basketball Channel" }
{ "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "Basketball Channel", "is_private": false, "is_ticketed": false, "ticket_price": 0, "free_variant": "best", "description": "", "static_playlist_url": ""https://play.boxcast.com/p/Z7a0XjcgnYpUIuKqvxGk/v/all-ext.m3u8?signed=yes" }
Returns all fields for the specified channel.
GET /account/channels/{id}
{ "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "2016 Basketball Season", "channel_id": "2016-basketball-season", "is_ticketed": true, "ticket_price": 24.95, "free_variant": "", "static_playlist_url": ""https://play.boxcast.com/p/Z7a0XjcgnYpUIuKqvxGk/v/all-ext.m3u8?signed=yes" }
Updates the supplied fields of the specified channel.
PUT /account/channels/{id}
Parameter | Type | Description | Remarks |
---|---|---|---|
name | string | The desired name for the channel. | Optional. |
is_ticketed | boolean | Whether or not the channel should be ticketed. | Optional. |
ticket_price | numeric | The desired ticket_price for the channel (ignored if not ticketed). | Optional. |
free_variant | token+ | The desired free_variant for the channel (ignored if not ticketed). | Optional. |
{ "name": "Basketball Channel" }
{ "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "Basketball Channel", "channel_id": "2016-basketball-season", "is_ticketed": true, "ticket_price": 24.95, "free_variant": "", "static_playlist_url": ""https://play.boxcast.com/p/Z7a0XjcgnYpUIuKqvxGk/v/all-ext.m3u8?signed=yes" }
Returns summary fields for all channels on the current account.
GET /account/channels
Valid filters:
filter.ids
: List of Channel IDsValid queries:
id
: Channel IDname
: Channel nameValid sorts:
name
: Channel name[ { "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "Basketball Channel", "channel_id": "2016-basketball-season", "is_ticketed": true, "ticket_price": 24.95, "free_variant": "" }, { "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "Football Channel", "channel_id": "2016-football-season", "is_ticketed": true, "ticket_price": 19.95, "free_variant": "" }, { "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "Softball Channel", "channel_id": "2016-softball-season", "is_ticketed": false, "ticket_price": 0, "free_variant": "" } ]
[ { "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "Basketball Channel", "channel_id": "2016-basketball-season", "is_ticketed": true, "ticket_price": 24.95, "free_variant": "" } ]
Returns minimal fields (id
, name
, starts_at
, stops_at
) for all broadcasts included in the specified channel. The list of broadcasts is presented in relevance order, meaning that broadcasts that are very recent (or coming very soon) will be listed ahead of older (or distant future) broadcasts. Any live broadcasts will be at the top of the list.
Allows for the same search and pagination behavior as the top-level broadcast list query.
GET /account/channels/{id}/broadcasts
GET /account/channels/dSUdyxXH1loPJYIlR4F0/broadcasts
[ { "id": "Z7a0XjcgnYpUIuKqvxGk", "name": "Celtics vs Knicks", "starts_at": "2013-04-28T23:00:00Z", "stops_at": "2013-04-29T02:00:00Z" }, { "id": "Y9udBwPJhqZvz05xt2As", "name": "Internal Test", "starts_at": "2013-04-28T21:00:00Z", "stops_at": "2013-04-28T21:10:00Z" }, { "id": "x1LUy0tRVj9mXuOEWP7k", "name": "Commencement 2013", "starts_at": "2013-05-02T14:00:00Z", "stops_at": "2013-05-02T22:00:00Z" } ]
A highlight represents a portion of a Broadcast that can be viewed independently. Each Broadcast can have multiple highlights.
Field | Type | Description |
---|---|---|
id | slug | The primary unique identifier. |
name | string | A human-friendly name for quick identification and display in user interfaces. |
broadcast_id | slug | The associated broadcast ID. |
preview | string | A URL to a thumbnail image for the highlight, if available. |
poster | string | A URL to a full-size poster image for the highlight, if available. |
description | text | Additional information to display to viewers about the highlight. |
duration | numeric | The duration in seconds of the highlight. |
the following fields are excluded from public summary responses | ||
start_seconds | numeric | Beginning of the highlight in seconds relative to the start of the broadcast's complete recording (unaffected by broadcast trimming). |
stop_seconds | numeric | End of the highlight in seconds relative to the start of the broadcast's complete recording (unaffected by broadcast trimming). |
Creates a new highlight from the supplied fields.
POST /account/broadcasts/{broadcast_id}/highlights
Parameter | Type | Description | Remarks |
---|---|---|---|
name | string | The desired name for the highlight. | Required. |
description | text | The desired description for the highlight. | Optional. |
start_seconds | numeric | The desired number of seconds relative to the start of the broadcast where the highlight begins. | |
stop_seconds | numeric | The desired number of seconds relative to the start of the broadcast where the highlight ends. |
{ "name": "Tip-off", "start_seconds": 120, "stop_seconds": 140 }
{ "id": "h9a0Xacgn7pUIuKqvxHj", "name": "Tip-off", "broadcast_id": "Z7a0XjcgnYpUIuKqvxGk", "description": "", "start_seconds": 120, "stop_seconds": 140, "duration": 20, "preview": "https://recordings.boxcast.com/previews/foo/bar/i9a0Xacgn2pUIuKqvxHj.png", "poster": "https://recordings.boxcast.com/posters/foo/bar/k9a0Xacgn3pUIuKqvxHj.png" }
Returns all fields for the specified highlight.
GET /account/broadcasts/{broadcast_id}/highlights/{id}
{ "id": "h9a0Xacgn7pUIuKqvxHj", "name": "Tip-off", "broadcast_id": "Z7a0XjcgnYpUIuKqvxGk", "description": "", "start_seconds": 120, "stop_seconds": 140, "duration": 20, "preview": "https://recordings.boxcast.com/previews/foo/bar/i9a0Xacgn2pUIuKqvxHj.png", "poster": "https://recordings.boxcast.com/posters/foo/bar/k9a0Xacgn3pUIuKqvxHj.png" }
Updates the supplied fields of the specified highlight.
PUT /account/broadcasts/{broadcast_id}/highlights/{id}
Parameter | Type | Description | Remarks |
---|---|---|---|
name | string | The desired name for the highlight. | Required. |
description | text | The desired description for the highlight. | Optional. |
start_seconds | numeric | The desired integer number of seconds relative to the start of the broadcast where the highlight begins. | |
stop_seconds | numeric | The desired integer number of seconds relative to the start of the broadcast where the highlight ends. |
{ "name": "Tip-off Won By Knicks", "description": "Way to start the game!" "stop_seconds": 130 }
{ "id": "h9a0Xacgn7pUIuKqvxHj", "name": "Tip-off Won By Knicks", "broadcast_id": "Z7a0XjcgnYpUIuKqvxGk", "description": "Way to start the game!", "start_seconds": 120, "stop_seconds": 130, "duration": 20, "preview": "https://recordings.boxcast.com/previews/foo/bar/i9a0Xacgn2pUIuKqvxHj.png", "poster": "https://recordings.boxcast.com/posters/foo/bar/k9a0Xacgn3pUIuKqvxHj.png" }
Returns summary fields for all highlights for the given broadcast. Please be aware that the results may be paginated.
GET /account/broadcasts/{broadcast_id}/highlights
Parameter | Type | Description | Remarks |
---|---|---|---|
q | string | Search query. | Optional. |
p | string | Page number. | Optional. |
l | string | Page size limit. | Optional. |
s | token | Sort order. | Optional. |
Valid queries:
name
: Highlight nameValid sorts:
streamed_at
: The time the highlight occurred[ { "id": "h9a0Xacgn7pUIuKqvxHj", "name": "Tip-off Won By Knicks", "broadcast_id": "Z7a0XjcgnYpUIuKqvxGk", "description": "Way to start the game!", "duration": 20, "start_seconds": 120, "stop_seconds": 140, "preview": "https://recordings.boxcast.com/previews/foo/bar/i9a0Xacgn2pUIuKqvxHj.png", "poster": "https://recordings.boxcast.com/posters/foo/bar/k9a0Xacgn3pUIuKqvxHj.png" } ]
Deletes a highlight from the broadcast.
DELETE /account/broadcasts/{broadcast_id}/highlights/{id}
Downloading a highlight as an MP4 is a multi-step process because BoxCast stores only streaming formats. The highlight must first be converted to an MP4, then a URL for download is made available.
Step 1: Prepare the download
POST /account/highlights/{id}/download
Parameter | Type | Description | Remarks |
---|---|---|---|
audio_only |
boolean | Default is false (downloads as audio+video mp4, vs audio-only m4a). | Optional. |
Step 2: Poll to monitor the download status until a download_url (or audio_download_url, if audio_only was requested) is available.
GET /account/highlights/{id}
{ "id": "highlight_id", "audio_download_status": "", "audio_download_url": "" "download_status": "requested|failed|processing:50|ready", "download_url": "https://...." }
An RTMP source provides a means of feeding RTMP stream data into the BoxCast platform An RTMP source has a human-readable name (listed on the sources page and anywhere a source can be selected); it also has an ingestion URL and stream key that you will plug into your RTMP streaming encoder.
NOTE: your encoder can stream to your RTMP source at any time; however, your content will only stream to viewers when you have a live broadcast configured to use your RTMP source as a source.
Field | Type | Description | Remarks |
---|---|---|---|
id | slug | The primary unique identifier. | |
name | string | The desired name for the RTMP source. | |
description | string | A user-provided description for the RTMP source. | |
server_url | string | The server URL to plug into your RTMP streaming encoder. | Read-only. |
stream_key | slug | The stream key to plug into your RTMP streaming encoder. | Read-only. |
static_playlist_url | string |
An M3U8 URL containing any currently-live, public broadcasts from this RTMP source.
NOTE: This M3U8 URL will return a 404 if there is no currently-live, public content.
NOTE: This URL can be used for integration into certain third party app providers. It should never be distributed directly to viewers. Also be aware that the use of this URL for watching the broadcast will skew your analytics. If you would like to retain analytics, your app should be updated to use one of the supported BoxCast SDKs.
|
Read-only. |
NOTE: different encoders accept URLs and stream keys in different ways; for example, your encoder may require you concatenate URL and stream key together (with a slash in between) as a single parameter. Check your encoder documentation and any available BoxCast help desk articles for more information.
Creates a new RTMP source from the supplied fields.
POST /account/static_rtmps
Parameter | Type | Description | Remarks |
---|---|---|---|
name | string | The desired name for the RTMP source. | |
description | string | The desired description for the RTMP source. |
{ "name": "Wirecast", "description": "Production booth Wirecast computer" }
{ "id": "Q9b1VkadIxkdsI93nkdco", "name": "Wirecast", "description": "Production booth Wirecast computer", "server_url": "rtmps://rtmp.boxcast.com/live", "stream_key": "Qid9aksdhlk9eiSKNd", "static_playlist_url": ""https://play.boxcast.com/p/Q9b1VkadIxkdsI93nkdco/v/all-ext.m3u8?signed=yes" }
Returns all fields for the specified RTMP source.
GET /account/static_rtmps/{id}
{ "id": "Q9b1VkadIxkdsI93nkdco", "name": "Wirecast", "description": "Production booth Wirecast computer", "server_url": "rtmps://rtmp.boxcast.com/live", "stream_key": "Qid9aksdhlk9eiSKNd", "static_playlist_url": ""https://play.boxcast.com/p/Q9b1VkadIxkdsI93nkdco/v/all-ext.m3u8?signed=yes" }
Updates the supplied fields of the specified RTMP source.
PUT /account/static_rtmps/{id}
Parameter | Type | Description | Remarks |
---|---|---|---|
name | string | The desired name for the RTMP source. | Optional. |
description | string | The desired description for the RTMP source. | |
regenerate_stream_key | boolean | Set to true to generate a new stream key. | Optional. |
{ "name": "New Name" }
{ "id": "Q9b1VkadIxkdsI93nkdco", "name": "New Name", "description": "Production booth Wirecast computer", "server_url": "rtmps://rtmp.boxcast.com/live", "stream_key": "Qid9aksdhlk9eiSKNd", "static_playlist_url": ""https://play.boxcast.com/p/Q9b1VkadIxkdsI93nkdco/v/all-ext.m3u8?signed=yes" }
Returns summary fields for all RTMP sources on the current account.
GET /account/static_rtmps
Valid filters:
filter.ids
: List of RTMP Source IDsfilter.stream_key
: RTMP Source Stream Keyfilter.stream_keys
: List of RTMP Source Stream KeysValid queries:
id
: RTMP Source IDname
: RTMP Source namedescription
: RTMP Source descriptionValid sorts:
id
: RTMP Source IDname
: RTMP Source namestream_key
: RTMP Source stream_key[ { "id": "Q9b1VkadIxkdsI93nkdco", "name": "Wirecast", "description": "Production booth Wirecast computer", "server_url": "rtmps://rtmp.boxcast.com/live", "stream_key": "Qid9aksdhlk9eiSKNd" } ]
[ { "id": "Q9b1VkadIxkdsI93nkdco", "name": "Wirecast", "description": "Production booth Wirecast computer", "server_url": "rtmps://rtmp.boxcast.com/live", "stream_key": "Qid9aksdhlk9eiSKNd" } ]
Deletes an RTMP source from the account.
DELETE /account/static_rtmps/{id}
Uploads can be used to provide additional media for broadcasts.
Creates a new upload from the supplied fields.
POST /account/uploads
Parameter | Type | Description | Remarks |
---|---|---|---|
filename | string | The file name for the upload. | Required. |
filesize | numeric | The size, in bytes, of the upload. | Required. |
mimetype | text | The MIME type of the upload. | Required. |
slot | token | The slot for the upload. Valid slots:
|
Required. |
{ "filename": "overlay.png", "filesize": 123, "mimetype": "image/png", "slot": "overlay" }
{ "id": "e0lbabxqsqfetjjc5bfs", "signed_upload": { "url": "https://s3.amazonaws.com/uploads.boxcast.com", "params": { "key": "overlay.png", "Content-Type": "image/png", "policy": "policy", "x-amz-credential": "credential", "x-amz-algorithm": "AWS4-HMAC-SHA256", "x-amz-date": "20201218T000000Z", "x-amz-security-token": "token", "x-amz-signature": "signature" } } }
Uploads the media for the specified upload. This is a multipart/form-data request.
------BOUNDARY Content-Disposition: form-data; name="key" overlay.png ----BOUNDARY Content-Disposition: form-data; name="Content-Type" image/png ----BOUNDARY Content-Disposition: form-data; name="policy" policy ----BOUNDARY Content-Disposition: form-data; name="x-amz-credential" credential ----BOUNDARY Content-Disposition: form-data; name="x-amz-algorithm" AWS4-HMAC-SHA256 ----BOUNDARY Content-Disposition: form-data; name="x-amz-date" 20201218T000000Z ----BOUNDARY Content-Disposition: form-data; name="x-amz-security-token" token ----BOUNDARY Content-Disposition: form-data; name="x-amz-signature" signature ----BOUNDARY Content-Disposition: form-data; name="file"; filename="overlay.png" Content-Type: image/png ----BOUNDARY--
Once the media has been uploaded the upload status needs to be updated.
PUT /account/uploads/{id}
Parameter | Type | Description | Remarks |
---|---|---|---|
status | token | The status for the upload. | Required. |
{ "status": "uploaded" }
{ "id": "e0lbabxqsqfetjjc5bfs", "filename": "overlay.png", "filesize": 123, "mimetype": "image/png", "created_at": "2020-12-18T00:00:00Z", "description": "", "slot": "overlay", "view_url": "https://uploads.boxcast.com/overlay.png", "status": "uploaded" }
Returns all fields for the specified upload.
GET /account/uploads/{id}
{ "id": "e0lbabxqsqfetjjc5bfs", "filename": "overlay.png", "filesize": 123, "mimetype": "image/png", "created_at": "2020-12-18T00:00:00Z", "description": "", "slot": "overlay", "view_url": "https://uploads.boxcast.com/overlay.png", "status": "uploaded" }
Returns summary fields for all uploads on the current account.
GET /account/uploads
Valid filters:
filter.slot
: Category of slotValid sorts:
created_at
: Date upload was created at[ { "id": "e0lbabxqsqfetjjc5bfs", "filename": "overlay.png", "filesize": 123, "mimetype": "image/png", "created_at": "2020-12-18T00:00:00Z", "description": "", "slot": "overlay", "view_url": "https://uploads.boxcast.com/overlay.png", "status": "uploaded" } ]
[ { "id": "e0lbabxqsqfetjjc5bfs", "filename": "overlay.png", "filesize": 123, "mimetype": "image/png", "created_at": "2020-12-18T00:00:00Z", "description": "", "slot": "overlay", "view_url": "https://uploads.boxcast.com/overlay.png", "status": "uploaded" } ]
Viewer Analytics provide a detailed look at the viewers of a Broadcast or a Channel.
Gets the viewer analytics for a broadcast with the supplied date range.
GET /account/viewer_analytics/{broadcast_id}
Parameter | Type | Description | Remarks |
---|---|---|---|
since |
date | Start date for viewer analytics. | Optional. If not provided, the default is shortly before the broadcast start time in the account's time zone. |
until |
date | Cutoff date for viewer analytics. | Optional. If not provided, the default is now. |
include_viewer_timeseries |
boolean | true to include viewer time-series data in the response. |
Optional. Defaults to false . |
{ "live_view_count": 0, "live_view_seconds": 0, "live_buffer_seconds": 0, "recorded_view_count": 7, "recorded_view_seconds": 13, "recorded_buffer_seconds": 6, "unique_viewer_count": 2, "viewed_broadcast_count": 1, "daily_view_counts": [0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], "weekday_hourly_view_counts": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "view_counts_by_quality": { "240p": 1, "720p": 6 }, "view_counts_by_host": { "boxcast.tv": 6, "dashboard.boxcast.com": 1 }, "view_counts_by_geohash": { "dpmguzcp94h8": 7 }, "view_counts_by_region_code": { "OH-US": 7 }, "view_counts_by_browser": { "Safari 13.0.5": 6, "Safari 13.1": 1 }, "view_counts_by_os": { "OS X 10.15.3": 6, "OS X 10.15.4": 1 }, "view_durations_by_quality": { "240p": 27, "720p": 342 }, "most_popular_broadcasts": [ { "broadcast_id": "gnz2vfaodkceal0sk3ot", "view_count": 7, "total_view_count": 7, "broadcast_name": "Rocket Launch", "broadcast_starts_at": "2019-05-13T16:00:00Z", "broadcast_stops_at": "2019-05-13T16:05:00Z" } ], "active_viewer_log": null }
Gets the viewer analytics for a channel with the supplied date range.
GET /account/viewer_analytics/{channel_id}
Parameter | Type | Description | Remarks |
---|---|---|---|
since |
date | Start date for viewer analytics. | Optional. If not provided, the default is 28 days (4 weeks) ago. |
until |
date | Cutoff date for viewer analytics. | Optional. If not provided, the default is now. |
include_viewer_timeseries |
boolean | true to include viewer time-series data in the response. |
Optional. Defaults to false . |
{ "live_view_count": 0, "live_view_seconds": 0, "live_buffer_seconds": 0, "recorded_view_count": 7, "recorded_view_seconds": 13, "recorded_buffer_seconds": 6, "unique_viewer_count": 2, "viewed_broadcast_count": 1, "daily_view_counts": [0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], "weekday_hourly_view_counts": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "view_counts_by_quality": { "240p": 1, "720p": 6 }, "view_counts_by_host": { "boxcast.tv": 6, "dashboard.boxcast.com": 1 }, "view_counts_by_geohash": { "dpmguzcp94h8": 7 }, "view_counts_by_region_code": { "OH-US": 7 }, "view_counts_by_browser": { "Safari 13.0.5": 6, "Safari 13.1": 1 }, "view_counts_by_os": { "OS X 10.15.3": 6, "OS X 10.15.4": 1 }, "view_durations_by_quality": { "240p": 27, "720p": 342 }, "most_popular_broadcasts": [ { "broadcast_id": "gnz2vfaodkceal0sk3ot", "view_count": 7, "total_view_count": 7, "broadcast_name": "Rocket Launch", "broadcast_starts_at": "2019-05-13T16:00:00Z", "broadcast_stops_at": "2019-05-13T16:05:00Z" } ], "active_viewer_log": null }
The following code samples are meant to help you get started using our API.
We use the following (non-functional) OAuth credentials: client ID cid1000
and secret secret9999
. Once you have
applied for and received your client ID and secret, replace the values with yours.
First, get your client ID and secret from the dashboard. Then use them as the user/password in the basic auth request to acquire a token.
$ export BOXCAST_CLIENT_ID=cid1000 $ export BOXCAST_SECRET=secret9999 $ curl -u "${BOXCAST_CLIENT_ID}:${BOXCAST_SECRET}" \ -d "grant_type=client_credentials" \ "https://auth.boxcast.com/oauth2/token" { "token_type":"bearer", "access_token":"YKLCJ-EJHnFXV4TThF7YNPdkyz3ia29UmCJY3vZOB", "expires_in":604800, "scope":"owner" }
import requests response = requests.post('https://rest.boxcast.com/oauth2/token', data={ 'grant_type': 'client_credentials', }, auth=('cid1000', 'secret9999')) print response.json() { u'token_type': u'bearer', u'access_token': u'YKLCJ-EJHnFXV4TThF7YNPdkyz3ia29UmCJY3vZOB', u'expires_in': 604800, u'refresh_token': u'kLHS6MTwTid9DxKK5r9ouzFEfT8PwQY1ZfONidd4', u'scope': u'owner' }
var request = require('request'); request.post({ url: 'https://rest.boxcast.com/oauth2/token', form: { grant_type: 'client_credentials', }, auth: { user: 'cid1000', pass: 'secret9999' } }, (err, response, body) => { if (!err && response.statusCode == 200) { console.log(JSON.parse(body)); } else { console.error(err, JSON.parse(body)); } });
You now have an access token along with the number of seconds before it expires.
This is not needed for client credentials grants. It is only required if you have an authorized partner integration with BoxCast and are using the Authorization Code grant.
First, direct browser to https://auth.boxcast.com/oauth2/auth?response_type=code&client_id=cid1000&redirect_uri=https%3A%2F%2Fexample.org%2Fcb&scope=owner&state=8CMZoxf6
.
Then, after the user is sent back to your configured redirect URL, grab the code e.g. c123456789
from the URL.
$ export BOXCAST_CLIENT_ID=cid1000 $ export BOXCAST_SECRET=secret9999 $ export CODE_FROM_URL=c123456789 $ export REDIRECT_URI=https://example.org/cb $ curl -u "${BOXCAST_CLIENT_ID}:${BOXCAST_SECRET}" \ -d "grant_type=authorization_code" \ -d "code=${CODE_FROM_URL}" \ -d "redirect_uri=${REDIRECT_URI}" \ "https://auth.boxcast.com/oauth2/token" { "token_type":"bearer", "access_token":"YKLCJ-EJHnFXV4TThF7YNPdkyz3ia29UmCJY3vZOB", "expires_in":604800, "refresh_token":"kLHS6MTwTid9DxKK5r9ouzFEfT8PwQY1ZfONidd4", "scope":"owner" }
import requests response = requests.post('https://rest.boxcast.com/oauth2/token', data={ 'grant_type': 'authorization_code', 'code': 'c123456789', 'redirect_uri': 'https://example.org/cb' }, auth=('cid1000', 'secret9999')) print response.json() { u'token_type': u'bearer', u'access_token': u'YKLCJ-EJHnFXV4TThF7YNPdkyz3ia29UmCJY3vZOB', u'expires_in': 604800, u'refresh_token': u'kLHS6MTwTid9DxKK5r9ouzFEfT8PwQY1ZfONidd4', u'scope': u'owner' }
var request = require('request'); request.post({ url: 'https://rest.boxcast.com/oauth2/token', form: { grant_type: 'authorization_code', code: 'c123456789', redirect_uri: 'https://example.org/cb' }, auth: { user: 'cid1000', pass: 'secret9999' } }, (err, response, body) => { if (!err && response.statusCode == 200) { console.log(JSON.parse(body)); } else { console.error(err, JSON.parse(body)); } });
You now have an access token along with the number of seconds before it expires.
Using the access token acquired above, you can query the rest of the BoxCast API on behalf of the authenticated user.
Here we search for broadcasts using the search filter timeframe:relevant
and ask for the 1st page sorted from newest to oldest.
$ export ACCESS_TOKEN=YKLCJ-EJHnFXV4TThF7YNPdkyz3ia29UmCJY3vZOB $ curl -H "Authorization: Bearer ${ACCESS_TOKEN}" \ -G \ --data-urlencode "q=timeframe:relevant" \ --data-urlencode "s=-starts_at" \ --data-urlencode "l=5" \ "https://rest.boxcast.com/account/broadcasts" [ { "admin_token": "c376bof7sbkairssvnfh", "boxcaster_id": "", "boxcaster_name": "", "stream_source": "app", "channel_id": "hockey-game-vs-st-marks-166959", "description": "", "free_variant": "best", "id": "1", "is_private": false, "is_ticketed": false, "name": "Hockey Game vs St. Marks (Audio Only)", "preview": "https://assets.boxcast.com/latest/static/audio-only.png", "poster": "https://assets.boxcast.com/latest/static/audio-only.png", "starts_at": "2016-12-01T12:30:00Z", "stops_at": "2016-12-02T14:30:00Z", "tags": [], "ticket_price": 0, "total_active_viewer_count": 0, "total_minutes_viewed": 0, "total_view_count": 0, "transcoder_profile": "audio", "viewer_url": "https://boxcast.tv/view/hockey-game-vs-st-marks-166959" }, ... ]
import requests response = requests.get('https://rest.boxcast.com/account/broadcasts', params={ 'q': 'timeframe:relevant', 's': '-starts_at', 'l': '5' }, headers={'Authorization': 'Bearer YKLCJ-EJHnFXV4TThF7YNPdkyz3ia29UmCJY3vZOB'} print response.json() [ { u'admin_token': u'c376bof7sbkairssvnfh', u'boxcaster_id': u'', u'boxcaster_name': u'', u'stream_source': u'app', u'channel_id': u'hockey-game-vs-st-marks-166959', u'description': u'', u'free_variant': u'best', u'id': u'1', u'is_private': false, u'is_ticketed': false, u'name': u'Hockey Game vs St. Marks (Audio Only)', u'preview': u'https://assets.boxcast.com/latest/static/audio-only.png', u'poster': u'https://assets.boxcast.com/latest/static/audio-only.png', u'starts_at': u'2016-12-01T12:30:00Z', u'stops_at': u'2016-12-02T14:30:00Z', u'tags': [], u'ticket_price': 0, u'total_active_viewer_count': 0, u'total_minutes_viewed': 0, u'total_view_count': 0, u'transcoder_profile': u'audio', u'viewer_url': u'https://boxcast.tv/view/hockey-game-vs-st-marks-166959' }, ... ]
var request = require('request'); request.get({ url: 'https://rest.boxcast.com/account/broadcasts', qs: { q: 'timeframe:relevant', s: '-starts_at', l: '5' }, auth: { bearer: 'YKLCJ-EJHnFXV4TThF7YNPdkyz3ia29UmCJY3vZOB' } }, (err, response, body) => { if (!err && response.statusCode == 200) { console.log(JSON.parse(body)); } else { console.error(err, JSON.parse(body)); } });