Skip to content

Webhooks

Webhooks let you build automation around BIMData API. Your app can subscribe to certain events on BIMData API and when one event is triggered, we’ll send an HTTP POST payload to the configured URL.

Webhooks can be configured on a cloud. All projects of this cloud emits events.

Events

Each event corresponds to a set of actions.

EventTriggered when…
bcf.topic.creationa BCF Topic is created
bcf.topic.updatea BCF Topic is updated
bcf.topic.deletiona BCF Topic is deleted
bcf.comment.creationa BCF comment is created
bcf.comment.updatea BCF comment is updated
bcf.comment.deletiona BCF comment is deleted
bcf.topic.full.creationa BCF Topic is created, send a FullTopic object
bcf.topic.full.updatea BCF Topic is updated, send a FullTopic object
ifc.process_updatethe status of an IFC is changed (when it’s processed)
project.updatea project is updated
project.creationa project is created
visa.creationa validation on a document is created
visa.updatea validation is updated
visa.validation.adda user responds to a validation demand
visa.validation.removea user delete a response to a validation demand
document.creationa document is uploaded
document.updatea document is updated

If you need more webhooks, please contact us at support@bimdata.io.

Payload

Every payload send by BIMData API looks like:

json
{ "event_name": event_name, "cloud_id": cloud_id, "data": payload }

Where:

  • event_name is the name of the triggered event.
  • cloud_id is the cloud that triggered the event.
  • payload is the content of the event.

It mostly uses the same serialization than the API Models.

Signature

To verify if the Webhook is sent from BIMData API and not from a malicious user, we sign out HTTP POST requests. The signature is an HMAC hex digest generated using the sha256 hash function and the secret as the HMAC key signing the body of the request.

This signature is sent over the x-bimdata-signature HTTP Header.

Here is a python example to check the signature:

python
import hmac
import hashlib

def is_signed(request):
    req_signature = request.META.get("HTTP_X_BIMDATA_SIGNATURE")
    if not req_signature:
        return False

    body_signature = hmac.new(
        WEBHOOK_SECRET.encode(), request.body, hashlib.sha256
    ).hexdigest()

    return hmac.compare_digest(req_signature, body_signature)

Authorizations

API routes to manage Webhooks require the webhook:manage scope. As these calls don’t involve a user, the app needs to be authorized itself on the Cloud and can’t behave as a User.