Skip to content

API Reference

The Ubstream API is REST styled and provides a predictable resource-oriented URLs. It uses JSON-encoded requests and responses, Bearer authentication and standard HTTP responses codes and verbs for most endpoints.

Requests and responses format

Requests body for POST, PUT and PATCH methods must be formatted to JSON with the Content-Type header set to application/json.

Almost all responses will be formatted to JSON format except those returning Binary content.

Whether a request succeeded is indicated by the Http Status Codes. A 2xx status code indicates success, whereas a 4xx or 5xx status code indicates failure. When a request fails, the response body is still JSON and contains diagnoses describing the error.

Diagnoses

Every HTTP response with failure HTTP Status Code DOES contain a diagnoses array in response body.
Every HTTP response with success HTTP Status Code CAN contain a diagnoses array in response body.

Nom Type Mandatory Description
$severity string true severity: can be error, warning, info, success
$message string true A message explaining the diagnose
$code number false A unique code corresponding to error on Ubstream backend
$title string false A title can help to contextualize diagnose
$detail string false The details about the diagnose

Example of HTTP response with failure HTTP Status Code:

{
    "$diagnoses": [
        {
            "$severity": "error",
            "$message": "Internal server error, please try again",
            "$detail": "Method Not Allowed"
        }
    ]
}

Authentication

Prerequisite: Ubstream account is needed to use Ubstream API. Please register.

API calls must be authenticated with an access token. See Authentication for an overview.

Basically, a bearer token must be passed in as an HTTP Authorization header.

Authorization

Ubstream platform provides a fine-grained permission system. A Bearer Token used for any authenticated call will provide associated account authorizations set on Ubstream resources like hubs, collections or medias.

See Authorization for authorization management endpoints overview.

Methods reference

The reference documentation of the API is available on Swagger API