Webhook ⚓

POST /webhook/{event_key}

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

application/json

Body

The webhook payload, format depending on the contract between Deck and the caller

Responses

  • 200 application/json

    Valid webhook call

    Hide response attributes Show response attributes object
  • 404 application/json

    Unknown event key

    Hide response attributes Show response attributes object
  • 400 application/json

    Bad parameters

    Hide response attributes Show response attributes object
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}'"
}