24 Web API
mattzz edited this page 2018-10-23 20:58:05 +02:00

Web API

Debug functions

URL Returns Description
/playback/<string:soundfile> json data plays back file in static/sounds/

internal calls

URL Returns Description
/qr/<string:name> QR image data used by /qrgen/<string:name>
/qrgen/<string:name> html, page with QR code used to generate and display QR image
/hello/<string:name> html, page with welcome message welcomes fully licensed Halloween operator
/dmesg output from dmesg rendered in info.html simple means of health monitoring
/reset_db ok in info.html resets status values in db
/discovery restul in info.html updates discovery data in db

Generic API

URL Verb Description
/ GET Returns master screen with buttons to trigger scary actions and scary sounds of all exhibits and to enable/disable the auto mode of the exhibits where applicable
/ping GET Returns the string "pong"
/auto_mode GET Returns the current auto mode state (on, off or na if auto mode is not supported)
/auto_mode?mode=[on|off] GET Changes the auto mode to on or off and then returns the current auto mode state (on, off or na if auto mode is not supported)
/auto_mode POST Changes the auto mode to value of accompanying data <next_mode>)
/scary_actions GET Returns list of IDs of scary actions supported by the local host
/scary_actions/<scary_action_id> POST Executes scary action <scary_action_id> on local host
/scary_hosts GET Returns list of IDs of remote hosts (=exhibits) that can be addressed via local host
/scary_hosts/<scary_host_id>/scary_actions GET Returns list of IDs of scary actions supported by the remote host /<scary_host_id>
/scary_hosts/<scary_host_id>/scary_actions/<scary_action_id> POST Executes scary action <scary_action_id> on remote host <scary_host_id>