Webhooks are a way to trigger an action following an event. They are mainly used to make two systems communicate with each other. Webhooks are a simple, effective manner of communicating to a system a state change that occurred in another system. Webhooks will notify distributors of state changes of various objects on our side, avoiding frequent calls to our API (polling).
Setup
A distributor can choose to create webhooks in our app.
For now, we are supporting the following state changes:
- creation of a new product (Product)
- update of an import task (ImportTask)
- update of a send task (SendTask)
- update of a platform state (DspState)
When creating a webhook, the distributor will need to fill in the following information:
- the type of state change they wish to be notified about,
- an unauthenticated URL that will be called when the state of the object is changed.
We will perform a POST request on this URL providing the following attributes in JSON:
= the id of the updated object = the new value of the property - <product_id> = the product id related if relevant
Example:
URL: https://api.idol.io/api/v1/callbacks
We will then trigger an HTTP call on the URL:
Code