REST API
Overview
The REST APIs provided by OME allow you to query or change settings such as VirtualHost and Application/Stream.
The APIs are currently beta version, so there are some limitations/considerations.
Settings of VirtualHost can only be viewed and cannot be changed or deleted.
If you add/change/delete the settings of the App/Output Profile by invoking the API, the app will be restarted. This means that all sessions associated with the app will be disconnected.
The API version is fixed with v1 until the experimental stage is complete, and the detailed specification can be changed at any time.
By default, OvenMediaEngine's APIs are disabled, so the following settings are required to use the API:
Setting up for using the APIs
Port
Set the <Port>
to use by the API server. If you omit <Port>
, you will use the API server's default port, port 8081
.
Host and Permissions
<Host>
sets the Host name and TLS certificate information to be used by the API server, and <AccessToken>
sets the token to be used for authentication when calling the APIs. You must use this token to invoke the API of OvenMediaEngine.
CrossDomains
If you face a CORS problem by calling the OME API on your browser, you can set <CrossDomains>
as follows:
If protocol is omitted like *.airensoft.com
, both HTTP and HTTPS are supported.
API Request/Response Specification
In this manual, the following format is used when describing the API.
<VERSION>/<API_PATH>
GET
http://<OME_HOST>:<API_PORT>/<VERSION>/<API_PATH>[/...]
Here is the description of the API
Request Example:
- Method: GET
- URL: http://1.2.3.4:8081/v1/vhost
- Header:
authorization: Basic b21ldGVzdA==
Path Parameters
Name | Type | Description |
---|---|---|
string |
Headers
Name | Type | Description |
---|---|---|
authorization | string |
|
OvenMediaEngine API uses Basic HTTP Authentication Scheme to authenticate clients. https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication
<OME_HOST>
This means the IP or domain of the server on which your OME is running.
<API_PORT>
This means the port number of the API you set up in Server.xml
. The default value is 8081.
<VERSION>
Indicates the version of the API. Currently, all APIs are v1.
<API_PATH>
Indicates the API path to be called. The API path is usually in the following form:
resource
means an item, such as VirtualHost
or Application
, and action
is used to command an action to a specific resource, such as push
or record
.
Response
All response results are provided in the HTTP status code and response body, and if there are multiple response results in the response, the HTTP status code will be 207 MultiStatus
. The API response data is in the form of an array of Response
or Response
as follows:
API Limitations
VirtualHost
settings created by Server.xml
cannot be modified through API. This rule also applies to Application
/OutputStream
, etc. within that VirtualHost. So, if you call a POST/PUT/DELETE API for VirtualHost
/Application
/OutputProfile
declared in Server.xml
, it will not work with a 403 Forbidden
error.
Last updated