Erizos Studio REST API Documentation
Introduction
Erizos Studio has a built-in REST API that allows you to control all aspects of the platform externally. This documentation describes the different components of the environment and the functions that can be executed on each of the components.
All the URLS in this document are appended to the IP address and PORT of the Erizos Studio Server.
http://[STUDIO SERVER IP]:[STUDIO SERVER PORT]
For example, if your installation of Erizos Studio Server is on the IP address 10.100.102.1, your endpoint will be:
http://10.100.102.1:5550
Component Hierarchy
it is important to understand the hierarchy of the component in Erizos Studio before you begin to work with the API:
Shows
|-- Templates
|-- Profiles
| |-- Channels
|
|-- Playlists
|-- Pages
Ports
The following table describes which port each service uses by default:
| Service | Port |
|---|---|
| Studio Server | 5550 |
| Studio (standalone / local mode) | 5500 |
| Agent | 5510 |
| MediaHub | 5600 |
| CreativeHub | 5700 |
| DataHub | 5050 |
Authentication
All API requests require an authentication, except for the public routes listed below.
Authentication can be a session token or the user credentials
Using a session token
Before executing an api request, a login to the system is required, server will return user data and a session token
POST /api/login
1 2 3 4 | |
The body may instead carry session, an existing session token, to re-validate it without sending the credentials again. A failed login answers HTTP 401 with {"status": "ERROR", "error": "..."}.
Response
1 2 3 4 5 6 | |
The response is the full User document with password and salt removed and permissionSet added.
all future requests should contain the session token as an Authorization: Bearer <token> header, an erizos-login: <token> header, or the query parameter erizos-login
e.g.
/api/some/where?erizos-login=d20c2c2a3ad88661
To end the session, call GET /api/logout .
Without a session token
All requests should have the username password in either the Basic authorization header username:password encoded with base64, an auth header (plain string), or as a query parameter auth (plain string)
/api/some/where?auth=myusername:MyPassword
When authentication fails
A request that needs authentication and does not carry valid credentials answers HTTP 403:
1 2 3 4 | |
Public routes
The following routes are served without any authentication:
| Route | Purpose |
|---|---|
/api/login |
Sign in |
/api/info |
Server name, version and mode |
/api/installers, /api/installers/[NAME] |
List and download the bundled installers |
/api/storage/* |
The whole Storage controller, including DELETE |
/api/assets/* |
Asset URL resolution and local file streaming |
/api/resources/libs |
The list of UI Builder script libraries |
/api/userinterfaces/webapps/* |
Published web apps |
/api/userinterfaces/[ID]/modules/* |
Script modules of a User Interface |
/api/systems/[SYSTEM]/*/projects/* |
Static files of a renderer project |
/api/js/* |
Client scripts |
Admin-only routes
Some routes are refused with HTTP 403 and {"error": "Forbidden"} unless the caller has the administrator role:
| Area | Routes |
|---|---|
| AsRun | every route |
| Backups | every route |
| Logs | every route except GET /api/logs/find and POST /api/logs/log |
| MOS | every route |
| Users | listing, creating and deleting users; the user roles routes. A user may always read and update itself |
| General | POST /api/settings, POST /api/restart, POST /api/files, POST /api/db/query |
| Engines | POST /api/engines/agents/upgrade |
Everything else is available to any signed-in user, subject to that user's permissions on the folder of the show, profile or engine involved. A permission failure answers HTTP 403 with {"error": "Forbidden: No Access"}.
Bugs & Errors
If you find any errors in the documentation or API please report them to support@erizos.tv.