API Endpoints
The Blue Pill system manager provides multiple API endpoints, that can be triggered by simple http requests. This can be useful in advanced scenarios, where external systems should trigger changes on a panel.
This is an advanced topic and basic knowledge of HTTP commands and control API's is expected.
Switching Reactor Projects
Reactor allows to switch the current project via an external HTTP POST request.
The endpoint used is: /reactorapi/selectproject
This request allows to use the skaarOS authentication via HTTP Basic Authentication (Use the latest version of system-manager to allow this (v1.0.1-pre1 and higher))
Curl example:
curl --location --request POST '192.168.0.20/reactorapi/selectproject' \
--header 'Authorization: Basic YWRtaW46c2thYXJob2o=' \
--header 'Content-Type: application/json' \
--data-raw '{"Filename":"MyProject"}'
Toggle Raw Panel Mode
Raw Panel Mode can be enabled/disabled on a Blue Pill inside panel.
This requires a POST request to the endpoint: /api/setrwpconfig
Curl example:
curl 'http://192.168.0.20/api/setrwpconfig' \
-H 'Content-Type: application/json' \
--data-raw '{"Activate":true}' \
--insecure
Toggle Package Status
A package running on a Blue Pill device, can be started or stopped by a API call.
This requires a POST request to the endpoint: /api/controlpackage/[package_name]
Curl example:
curl 'http://192.168.0.20/api/controlpackage/reactor' \
-H 'Content-Type: application/json' \
--data-raw '{"Action": "start"}' \
--insecure
(if authentication is enabled it needs HTTP BasicAuth as well with username and password)
Monitoring Package Status
The status of a package can be enquired by the following call.
This requires a POST request to the endpoint: /api/controlpackage/[package_name]
Curl example:
curl 'http://192.168.0.20/api/controlpackage/core-bmd-atem' \
-H 'Content-Type: application/json' \
--data-raw '{"Action": "status"}' \
--insecure
(if authentication is enabled it needs HTTP BasicAuth as well with username and password)
This will return a json response, like this:
{"Status":"ok","Data":{"runState":true,"startOnBoot":false,"packageHasControl":true,"ingressPath":"","inMenu":false}}
No Comments