Webhook JSON format
We'll need to standardize the API of the requests that are initiated by the C++.
This seems to involve:
-
Figuring out a proper "name" to include in each webhook call, like
file-not-found
orstream-connection-failed
. -
Including a payload of the relevant JSON object for the API resource. For example, the JSON for the file output when the LAME encoding process initiates or finishes (
file-output-encoding-done
).
Example
// POST http://localhost:3300/audio-player-webhook
{
// Include a type for this API object (
"type": "webhook",
// Debug level: Info, warning, error, etc.
"level": "info",
"instance": "station-one",
// A unique name for this type of webhook.
"name": "file-output-encoding-started",
// Alternative to name?
"path": "GET /instances/instance-1/sources/source-1"
// Send the full API output for the relevant Output/Source.
"data": {
"type": "output",
"name": "recorder-1",
"filePath": "/path/to/file.mp3",
"temporaryWavPath": "/path/to/temporary/wav/file.wav",
...
}
}
https://labs.creek.fm/open/audio-server/wikis/Config/Webhooks
Edited by Travis