Table of Contents |
---|
API URLs
Web Call Server uses two URLs for REST API
HTTP | HTTPS |
---|---|
http://host: |
8081/rest-api | https://host: |
8444/rest-api |
To invoke the REST API, you have to make request using the following format:Протокол: HTTP или
- Protocol: HTTP or HTTPS
- Content Type:
...
- application/json
Метод: POST
...
- Method: POST
- Body: JSON
Settings
Ports
By default, server accepts REST HTTP requests on 8081 TCP port and REST HTTPS requests on 8444 TCP port. Those values are defined with the following settings in flashphoner.properties file
Code Block | ||||
---|---|---|---|---|
| ||||
http.port=8081
https.port=8444 |
In WebCallServer previous versions, the manager module handles REST queries on 9091 and 8888 ports respectively. For existing web applications to work after server update, the following parameters are provided in wcs-manager.properties file
Code Block | ||||
---|---|---|---|---|
| ||||
-Dmanager.rest_redirect_http_port=8081
-Dmanager.rest_redirect_https_port=8444 |
Authorization
REST API requests are handled without user authorization by default. HTTP basic authorization may be enabled with the following parameter in flashphoner.properties file if necessary
Code Block | ||||
---|---|---|---|---|
| ||||
disable_rest_auth=false |
When authorization is enabled, REST API users are managed from WCS core CLI.
Cross-domain requests
Cross-domain request are managed with the following settings in flashphoner.properties file
Code Block | ||||
---|---|---|---|---|
| ||||
rest_access_control_allow_origin=*
rest_access_control_allow_headers=content-type,x-requested-with
rest_access_control_allow_methods=POST |
By default, cross-domain requests from any address are allowed, to make port redirection work.
Testing
For testing purpose you can use a REST client. I.e. Advanced REST Console for browser Google Chrome.
On the screenshot below you can see how to get list of streams by REST API using Advanced REST Console and REST method /stream/find_all