Webhooks
Overview

Webhooks are an under development feature

Sending of events to webhooks happen out of request (asynchronously) and are sent to a messenger queue. Processing of these hook calls may be delayed. So when determining the moment which the event occurred, you should consider using the time of the event in the payload (timestamp), not the time of the webhook call.

It is possible that a webhook will be called twice for the same event. For "deduplication" we have an id field on the event (int)

Content of payload may vary / change without warning, use with caution.

Todo

  • Hide sensitive data from webhook payload
  • Add messenger to production, so we can actually process events
  • Add a way to register webhooks
  • Implement contact hooks
  • Implement quotation hooks
  • Implement invoice hooks
  • Create zapier integration for adding contact
  • Create zapier integration for adding quotation
  • Create zapier integration for adding invoice's
  • Document webhook payload's
  • Document API (for creates)
  • Implement note hooks
  • Implement 410 unsubscribe
  • Implement 500 error handling

Ondersteunde events

  • QUOTATION_CREATED,
  • QUOTATION_CONTENTS_UPDATED,
  • QUOTATION_STATUS_UPDATED,
  • QUOTATION_DELETED,
  • INVOICE_CREATED,
  • INVOICE_CONTENTS_UPDATED,
  • INVOICE_STATUS_UPDATED,
  • INVOICE_DELETED,
  • CONTACT_CREATED,
  • CONTACT_UPDATED,
  • CONTACT_DELETED,
  • NOTE_CREATED,
  • NOTE_UPDATED,
  • NOTE_DELETED,

Default webhook structure

{
  "id": unique event identifier (usually timestamp + metadata.hashCode() at time of creation of the event),
  "timestamp": timestamp,
  "eventName": eventType,
  "payload": {},
  "metadata": {
    "company_profile_id": "UUID"
  }
}

Hook implementation notes

  • If you want us to unsubscribe a hook, you should send us a 410 Gone response code
  • Whenever a 500 error code is given, the owner of the hook and the owner of the company profile will be notified