...
Code Block | ||||
---|---|---|---|---|
| ||||
http.port=8081 https.port=8444 |
...
Cross-domain requests
Cross-domain request are managed with the following settings in flashphoner.properties file
Code Block | ||||
---|---|---|---|---|
| ||||
-Dmanager.rest_access_redirectcontrol_httpallow_portorigin=8081 -Dmanager.rest_redirect_https_port=8444* 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.
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
...
When authorization is enabled, REST API users are managed from WCS core CLI.
...
For cross-domain requests
...
Cross-domain request are managed with the following settings , custom headers have to be added using the following parameter in flashphoner.properties file file:
Code Block | ||||
---|---|---|---|---|
| ||||
rest_access_control_allow_origin=* rest_access_control_allow_headers=content-type,x-requested-with rest_access_control_allow_methods=POST |
...
Access-Control-Allow-Origin: <origin>;Access-Control-Allow-Credentials: true;Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS;Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization |
Here <origin>is the request source, e.g. http://test.flashphoner.com.
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
OpenAPI specification
Since build 5.2.1343 REST API can be displayed and tested according to OpenAPI 3 specification. OpenAPI specification file can be downloaded by URL https://demo.flashphoner.com:8444/rest-api/openapi_spec in YAML format, UI is vailable by URL https://demo.flashphoner.com:8444/rest-api-spec/, where demo.flashphoner.com
is WCS server address
Every REST API query can be explored and tested using Swagger UI
Required fields are marked by *
character on Schema
tab.