What are webhooks?
Webhooks are notifications sent by BrickControl to other external softwares, to notify them of any events occurring in BrickControl (for example: invoice X has been saved, customer X has been deleted…).
How do webhooks work?
You just need to subscribe to a BrickControl webhook event. To use this functionality you have to subscribe indicating the name of the event you want to subscribe to (for example customer.save) and the url where you want to receive the notification. As soon as the event you subscribed to is executed (for example that a client is saved), BrickControl will send you a JSON to the url you indicated when you subscribed to that event.
In the url you specified, you must have already prepared your REST web service, enabling it to receive a POST and read the JSON object that is sent yo. Once you receive this, using your own development environment you will be able to do any action you require, such as saving that client in other software.
How do I subscribe to an event?
If you haven’t called any of our API methods yet, please read the following information before doing so:
To subscribe to an event you must call the following API method:
Note: You must replace the TargetUrl with your own URL, which should properly configured in order to receive these notifications.
How do I see all the events to which I am subscribed to?
To see all the events to which you are subscribed to, you have to call the following API method:
How do I see if I am subscribed to an event?
To see if you are subscribed to an event with a specific code you have to call the following API method:
Where “id” is the code of the event you want to obtain
How can I test if the webhook is sending me the notification correctly?
So that you can test if you have subscribed to a BrickControl event, we have created a series of urls that when you subscribe to the event through that URL sends you an email with the JSON every time that event occurs.
Example URL: https://brickcontrol.com/api/v5/Hooks/Test/Customerfirstname.lastname@example.org
If you subscribe to an event with this payload, every time a client is saved in BrickControl, an email will be sent to “email@example.com” (modify that email to yours) with the JSON it is sending to the URL.
This is just for you to test the webhook, when you use it you must have a URL that is able to receive that JSON and process it.
Whhich type of events can I subscribe to?
URL test: https://brickcontrol.com/api/v5/Hooks/Test/Customerfirstname.lastname@example.org
URL test: https://brickcontrol.com/api/v5/Hooks/Test/Supplieremail@example.com
URL test: https://brickcontrol.com/api/v5/Hooks/Test/Employeefirstname.lastname@example.org
URL test: https://brickcontrol.com/api/v5/Hooks/Test/Projectemail@example.com
Invoice of purchase
URL test: https://brickcontrol.com/api/v5/Hooks/Test/PurchaseInvoicefirstname.lastname@example.org
Reception of materials
URL test: https://brickcontrol.com/api/v5/Hooks/Test/ReceptionOfMaterialsemail@example.com
Part of work
URL test: https://brickcontrol.com/api/v5/Hooks/Test/TimeSheetfirstname.lastname@example.org
URL test: https://brickcontrol.com/api/v5/Hooks/Test/SaleInvoiceemail@example.com
URL test: https://brickcontrol.com/api/v5/Hooks/Test/Itemfirstname.lastname@example.org
URL test: https://brickcontrol.com/api/v5/Hooks/Test/PurchaseOrderemail@example.com
Transfer of equipment
URL test: https://brickcontrol.com/api/v5/Hooks/Test/MaterialTransferfirstname.lastname@example.org
URL test: https://brickcontrol.com/api/v5/Hooks/Test/Useremail@example.com
Form of payment
URL test: https://brickcontrol.com/api/v5/Hooks/Test/PaymentMethodfirstname.lastname@example.org
Unit of measure
URL test: https://brickcontrol.com/api/v5/Hooks/Test/MeasurementUnitemail@example.com
URL test: https://brickcontrol.com/api/v5/Hooks/Test/Taxfirstname.lastname@example.org
If you need an event that is not in this list, please request it in our support web site.