====== Audio Logger REST Interface ====== ===== General Notes ===== API is located on http://ip-of-machine:5252, or whatever port the user chose. Audio Logger uses HTTP Basic authentication. For anonymous access, no auth header must be sent. For admin access, use user name "admin" and the password specified in config. ===== API Description ===== ==== Retrieve list of slots ==== GET /ws/slots Returns a JSON array with the available recording slots - note that the first slot ID is 0, while in the GUI it's 1. Example output: { "ID": 0, "Name": "eldo", "Source": "http://sender.eldoradio.de:8000/128", "Recording": true } ==== Retrieve name of slot ==== GET /ws/slots//name Returns name of the given slot as a simple string. ==== Retrieve record source of slot ==== GET /ws/slots//soure Returns record source (stream URL or soundcard input name) of the given slot as a simple string. ==== Retrieve recording status of slot ==== GET /ws/slots//recording Returns the recording status of the given slot as true/false. ==== Get silence duration ==== GET /ws/slots//silence Returns the number of seconds that have passed since the signal was last over the silence threshold. Silence threshold must be set in config for this to work. ==== Get last metadata update ==== GET /ws/slots//lastmetadata Returns the number of seconds that have passed since the last metadata update was received from the recorded stream. Only works for stream inputs. ==== Get current song title ==== GET /ws/slots//currenttitle Returns the title of the current song in the received stream. Only works for stream inputs. ==== List recordings ==== GET /ws/slots//list/// Returns the list of recordings for the particular slot on the particular date as a JSON array. ==== Retrieve audio file ==== GET /ws/slots//getfile/ Downloads the audio file for the specified recording, ==== Execute command ==== POST /execute POST /ws/execute Excutes the command given as the "command" parameter in the POST data. Available commands are currently: | SLOT START | Start recording on the given slot* | | SLOT STOP | Stop recording on the given slot* | * Note: Slot numbers are 1-based! * Note: Up v1.3.3, only ''/execute'' was supported as the endpoint. From v1.3.4, ''/ws/execute'' should be used.