Webhook
Webhooks allow you to receive real-time notifications of events happening within your Extracta.ai extractions. This section will guide you through setting up a Node.js server with Express to securely listen for and handle webhook events.
Webhook Payload Structure
Each webhook sent by Extracta.ai will include two primary fields in the request body:
event
â A string identifying the type of event (e.g.,extraction.processed
,extraction.failed
).result
â A list containing files data
Example payload:
See all event types
Prerequisites
Node.js installed on your server
An Express.js application
A secret key obtained from the Extracta.ai dashboard
Step 1: Set Up Your Server
First, ensure you have Express and the necessary packages installed in your project. If not, you can install them using npm:
Step 2: Implement Webhook Endpoint
Create a basic HTTP server with Express to listen for webhook POST requests. Use the following code snippet as a starting point:
Step 3: Test Your Webhook Listener
Once your webhook listener is set up, test it by triggering events from Extracta.ai. Confirm that:
The signature is validated correctly.
The
event
is identified.The
result
is handled based on the event type.
By following these steps, you can securely set up your application to receive and process webhook events from Extracta.ai, enabling real-time updates and actions based on the events transmitted to your endpoint.
Last updated
Was this helpful?