Webhooks
Webhooks let you receive notifications about certain events without polling the API.
You have to configure a URL that will be called by our system with a GET
HTTP request for each event type you want to listen to with the endpoint PUT /api/v6/webhooks/{eventType}
When the webhook fails, we have a retry system that resends it. A notification email will be sent to you in case of failure. After 10 failed attempts, the webhook is disabled. To receive it again, you must reactivate it.
These query parameters will be sent to the url you specify:
- eventType : Type of event, see list below
- resourceId : Id of the object that triggered the event
- userId : Id of the user owning the object that triggered the event
- date : Unix timestamp
- nonce: Nonce
And header:
- x-webhook-signature:
sha256=<signature>
(without surrounding carets)
signature = base64_frombytes(hmac_sha256(secret
, requestUrl
)) where requestUrl
is the complete url of the webhook request (including query arguments), secret
is your webhook secret. The resulting digest is base64-encoded.
UPDATE webhook secret
PUT /api/v6/profile/webhook-secret
Revokes/reset your webhook signature secret. The response is the new secret that will be used to sign future webhook requests.
Response
{
"secret": "QQF909SvZ6AKFntP2RNiDdlKIQPuY8CwVoCMsoJVDLqWywDeRjtj+tos1JcQGgoQDy2g8gGwOB/CjOQApX+Bng=="
}
Example:
https://www.your-app.com/hooks?eventType=DATA_CONNECTION_CONNECTED&resourceId=d0e497f1-6052-4f0d-b876-d4e6d7cf25bc&date=1609459200&nonce=ff3a4945c82d0594e75b4588ddd416f0f6652882364c1769666eb0930d767e61a01ace35dab562ac359bc65c38fe4161e7cc93648a5da1db2aa2d1a139c5b3cd
List of possible event types
Event Type | Resource Id | Description |
---|---|---|
DATA_CONNECTION_AUTH_REQUIRED | DataConnection | The data connection is created and requires an authorization from the user |
DATA_CONNECTION_CONNECTING | DataConnection | The user has begun the authorization procedure |
DATA_CONNECTION_CONNECTED | DataConnection | The data connection is ready to be used for data synchronization |
DATA_CONNECTION_AUTH_ERROR | DataConnection | The user needs to re-authorize the data connection |
DATA_CONNECTION_DISCONNECTED | DataConnection | You asked to disconnect the data connection |
DATA_SYNC_QUEUED | DataSync | A data synchronization has been asked |
DATA_SYNC_AUTH_ERROR | DataSync | A data synchronization ended with an authorization error. The corresponding data connection status also change to AUTH_ERROR. The user needs to re-authorize the connection |
DATA_SYNC_FETCH_ERROR | DataSync | A data synchronization ended with an error. This might be due to a temporary error. You should retry the synchronization |
DATA_SYNC_FETCHING | DataSync | A data synchronization has been started |
DATA_SYNC_SUCCESS | DataSync | A data synchronization ended successfully |
REPORT_SUBMITTED | Report | The report request has been sent successfully |
REPORT_PROCESSING | Report | The report is being generated |
REPORT_DONE | Report | The report generation has ended successfully |
REPORT_DONE_NO_DATA | Report | The report generation has ended successfully but there is no data in the report |
REPORT_CANCELLED | Report | The report generation has been canceled or has failed |