๐๏ธ Introduction
Hooks, or webhooks are HTTP(s) URIs you can register on the Storage & Hooks page of the Cloud Dashboard. After registration, the details of each successful vehicle API request (including the full API result and a link to the image processed) will be sent to these URIs in HTTP POST requests.
๐๏ธ Enabling Event Storage
As discussed earlier, enabling Event Storage is a prerequisite for using Hooks.
๐๏ธ Steps of Registering a Hook
Before registering your first Hook, it is useful to have a high-level overview of the steps it involves.
๐๏ธ Setting Up a Web Server
Next you need to set up an Internet-facing web server to process incoming confirmation and webhook HTTP requests. In this section we will set up a Python-based web server which logs all requests to the standard output for testing purposes. By looking at the logs, you will see the structure of confirmation and webhook requests and will learn how to integrate hook functionality into a larger application.
๐๏ธ Registering the Hook
You can register a Hook using the Cloud Dashboard web UI.
๐๏ธ Confirming the Subscription
If you have successfully registered the Hook using either method in the previous section, the test web server must already have logged the subscription request. Switch to the terminal and check the logs.
๐๏ธ Testing the Hook
Before testing the hook, make sure that the test server we have set up in this section is running and that you have a console window open where you can watch its standard output.