Setting up webhooks

This page will show you how to setup a webhook to receive events.

To receive events, you need to set up a webhook. One customer can only set up one Webhook.

This page will explain how to set up a webhook and has the following sections:

Creating a webhook

This is how to create a webhook:

curl {baseURL}/webhooks  
-H "Authorization:your-api-key"  
-H "Content-type: application/json"  
-X POST
-d '{
  "url": "https://your.url.com",
  "webhookKey": "Any key"
}'

An explanation of all fields can be found here

🚧

HTTPS only

The webhook URL provided must be over HTTPS. If the webhookKey is not provided one will be gererated for you.

The response will look like this

{
  "id": "id of the new webhook",
  "url": "url of the webhook",
  "webhookKey": "Key for the webhook",
  "traderId": "id of the trader",
  "webhookEvents": [
    "ALL"
  ]
}

Getting all webhooks

This is how to get all the webhooks:

curl {baseURL}/webhooks?traderId={traderId}  
-H "Authorization:your-api-key"  
-H "Content-type: application/json"  

The response will look like this

{
  "webhooks": [
    {
      "id": ":webhook_id",
      "url": ":webhook_url",
      "webhookKey": ":webhook_key",
      "traderId": ":trader_id",
      "webhookEvents": [
        "ALL"
      ]
    }
  ]
}