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
-
event_key string Required
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
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}'
{
"sample_input_1": "123AMA",
"sample_input_2": 7894
}
{
"status": "OK",
"message": "Event 'test-event' received with 2 input parameters. Processing will begin and results should be visible on Deck within 5 minutes."
}
{
"status": "ERROR",
"message": "Unknown event key 'yolo'"
}
{
"status": "ERROR",
"message": "Unexpected parameters provided for event key 'notify-new-product'. Expected something like '{product_code: AA99}'"
}