With Webhooks you can create custom automatizations utilizing the digital output of your camera or even activate various internet-connected devices which can be triggered using URL command. At this time our system can do only POST requests to the end devices so if your camera/device requires another type of input you can use an intermediate service like zapier.com↗️ to transform POST into any other input that your device can accept.
To start creating new automatization first you will need to consult with your device user manual to find out how the commands should be formatted and what type of authentication is supported. For example on Vivotek camera a command to activate digital output will look like this:
http://ipAddress:port/cgi-bin/dido/setdo.cgi?do0=1
Sending the command like this will result in activation of the Digitial output port on the camera but only if the current session is already authorized. To include the authorization credentials in the command in most cases you can add the username and password before the IP address, separating the username from the password with a column ":" followed by the "@" symbol at the end, like this:
http://userName:password@ipAddress:port/cgi-bin/dido/setdo.cgi?do0=1
Once you know the command that can be accepted by your camera/device you can start configuring triggers to activate the function you need. This can be something as simple as an LED light turns on when the command is sent to the camera or as complex as the start of a production line in the factory when specific conditions are met. Following is a simple example of turning on the LED light connected to the Digital Output of the Vivotek FD8182-F1 camera, following this logic you can expand the scope of possibilities to virtually any project.
Creating webhook
To initiate a sequence a trigger condition must happen. You can choose from a variety of possibilities from the webhook creation tool. Open the Admin portal↗️ and choose a customer for whom you want to create an automatization. Go to the Alerts menu, choose the Webhooks tab and click Create Webhook button to start the Webhook creation wizard:
If your device can accept POST requests you can enter the URL field IP address and command for your automation and proceed with the Webhook creation, otherwise you will need to use 3rd party service to convert POST requests into a request that your device can understand. In this example the camera cannot accept the POST command, it can only be activated by GET requests so an intermediate service (zapier.com↗️) is used to convert POST into GET. This conversion has to be configured on the zapier website.
Configuring zapier.com↗️
To create a new click conversion zap click on the Create Zap button from the Dashboard on zapier.com↗️ to start the wizard:
Under Choose app & event select Webhooks by Zapier option:
In the next step, you will see the link for this Webhook. Copy this link, this is the link you will use in our Admin portal when creating a new webhook:
Testing Webhook
The next step tests the new webhook trigger, so you will need to use the copied link to create a new Webhook and ping it from the Admin portal. This will send the first request to Zapier which is enough to test the service:
Configuring Action
Now it is time to configure the Action that will be activated by the webhook. In the first step choose Webhooks by Zapier and choose Custom Request:
For the camera model in this example, it is important to use GET as a Method and to include UserName and Password in the URL followed by IP address, port, and the actual command that has to be executed. Depending on your camera/device another combination of settings for Action webhook might be more appropriate, consult with your device user manual to learn what is the correct procedure to send commands using URLs and what type of authentication is required.
The next step will test your Action webhook. When you press test your device should respond as you expect it to. In this example an LED array connected to the camera's digital output lights up when the test is completed:
Continue Webhook creation
After URL is created and is working you can proceed with the webhook configuration. Choose one or more triggers that will start your automation:
Note: In our platform, "Analytics" refers to any object detection event generated either by our platform or by smart cameras. When setting up webhooks, selecting "Analytics" as an event trigger equates to selecting object detection.
Next, choose what role will be associated with this webhook. This will determine events from which cameras will trigger the webhook. Also in this step, you can choose how the webhook will be formate and what information will be included with it.
A variety of special events can be generated by security guards from the alarm station. This allows you to fine-tune your automation sequence to do exactly what is expected.
This is an example of what information can be included in the 3dEYE JSON payload:
Here is an example of how this works in real-life application: