What are Webhooks?
Webhooks allows you to receive data and get notified at real-time about the ongoing events during the interaction of the FACEIO Widget with your users (eg. New facial enrollment or authentication) in-order to keep your application backend up-to-date & synchronized. FACEIO uses Webhooks to let your system know when such events happen. Events includes New User Enrollment, Facial Authentication Success, Facial ID Deletion and many other events.
When an event occurs, FACEIO makes an HTTP POST request to the URL you configured for the Webhook. FACEIO’s request includes details of the ongoing event such as the Unique Facial ID of the user being enrolled or authenticated, its gender & age in case of new enrollment, timestamps, event type, IP information, linked payload, and many others details.
Setting up Webhooks
Setting up Webhooks for your application is straightforward. Follow the steps below to register your first webhook endpoint URL:
- Connect to your account via the FACEIO Console first.
- From the console main view, visit the Application Manager .
- Select the target application for which you want to setup webhooks for.
- Navigate to the WEBHOOKS tab from the manager main view.
- Once the target application selected. Enter your Webhook Endpoint URL for receiving events and save your modification.
- You're all set. Upon an event is triggered, FACEIO shall make an HTTP POST request to the URL you configured for the Webhook with the below details.
HTTP Request Details
Your Webhook Endpoint URL, must be able to handle the incoming HTTP request initiated by FACEIO whenever an event is triggered. Below, details of the incoming HTTP Request:
|POST Payload||JSON Object. Refer to the section below for the expected body fields.|
Your HTTP server must be able to accept the incoming POST request in less than 6 seconds. Passing this delay, FACEIO shall automatically abort the connection.
|Specific to each application
You can verify the authenticity of the request by inspecting the Bearer token value embedded in the
Post Request Body
Below, the body of the incoming HTTP POST request initiated by FACEIO. The body is a
JSON Object with the following fields:
You can rely on the accompanying
WWW-Authenticate HTTP header token value (found on the FACEIO Console) to verify the authenticity of the request.
||is the event name that triggered this particular request.|
||is the Unique Facial ID of the user being enrolled or authenticated|
||is the Public ID of the application that triggered this particular request. You can find all your applications Public IDs on the FACEIO Console.|
||is the public IP address that triggered
||is the data you have already associated to this particular user (if any) during his enrollment. The same data will also be forwarded back to your JS frontend on future authentication of the same user. The
Optionally, the following object fields from the already sent
JSON body are always included in case of new user enrollment.