Webhook ⚓
Use this endpoint to notify Deck of something happening outside of it. Some actions will be triggered depending on the event key and the caller. The event key and its consequences have to be defined with Deck team before using it, as it will be custom behaviours. If you want to test an API call before having a real event in place, use "test-event" as event_key. It will not do anything but will reply with an OK.
Path parameters
-
The event key to call, as given by Deck
Body
The webhook payload, format depending on the contract between Deck and the caller
-
sample_input_1 string
A sample input as a string
-
sample_input_2 integer
A sample input as an integer
POST
/webhook/{event_key}
curl \
-X POST https://api.ppe-analytics.com/api/v1/webhook/test-event \
-H "PPEApiKey: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"sample_input_1":"123AMA","sample_input_2":7894}'
Request examples
{
"sample_input_1": "123AMA",
"sample_input_2": 7894
}
Response examples (200)
{
"status": "OK",
"message": "Event 'test-event' received with 2 input parameters. Processing will begin and results should be visible on Deck within 5 minutes."
}
Response examples (404)
{
"status": "ERROR",
"message": "Unknown event key 'yolo'"
}
Response examples (400)
{
"status": "ERROR",
"message": "Unexpected parameters provided for event key 'notify-new-product'. Expected something like '{product_code: AA99}'"
}