Extracta.ai
DashboardJoin Discord
  • extracta.ai
    • Introduction
    • Overview
  • API Reference
    • 🔓Authentication
    • 📁Supported File Types
  • Data Extraction - API
    • đŸ’ģAPI Endpoints - Data Extraction
      • 1. Create extraction
      • 2. View extraction
      • 3. Update extraction
      • 4. Delete extraction
      • 5. Upload Files
      • 6. Get results
    • Extraction Details
      • 🌎Supported Languages
      • âš™ī¸Options
      • 📋Fields
    • Receiving Batch Results
      • Polling vs Webhook
      • How to use the Webhook
    • đŸ•šī¸Postman Integration
  • Document Classification - API
    • đŸ’ģAPI Endpoints - Document Classification
      • 1. Create classification
      • 2. View classification
      • 3. Update classification
      • 4. Delete data
        • 4.1 Delete classification
        • 4.2 Delete batch
        • 4.3 Delete files
      • 5. Upload Files
      • 6. Get results
    • Classification Details
      • 📄Document Types
  • Documents
    • Custom Document
    • Resume / CV
    • Contract
    • Business Card
    • Email
    • Invoice
    • Receipt
    • Bank Statement
  • Support
    • 💁Tutorials
    • đŸŸĸAPI Status
  • Contact
    • 📧Contact Us
    • ❓FAQ
Powered by GitBook
On this page
  • Polling
  • Instructions for Polling:
  • Webhook
  • Instructions for Using Webhook:

Was this helpful?

  1. Data Extraction - API
  2. Receiving Batch Results

Polling vs Webhook

Polling

Polling is a method where your application will repeatedly make a request to the /getBatchResult endpoint to check if the batch processing has been completed. This is done by sending requests at regular intervals, using the extractionId and batchId received from the /uploadFiles endpoint.

Instructions for Polling:

  1. After calling /uploadFiles, store the extractionId and batchId from the response.

  2. Make a POST request to /getBatchResult with the extractionId and batchId.

  3. If the batch is not yet processed, wait a few seconds and then send the request again.

  4. Repeat step 3 until you receive a response indicating that the batch status is finished.


Webhook

Webhooks provide a way to receive a callback notification to a specified URL endpoint when an event occurs, in this case, when a batch processing is complete. Instead of your application checking in at regular intervals, the API will send a POST request to the endpoint you configured with the results once they are ready.

Instructions for Using Webhook:

  1. Configure your webhook URL and secret in the dashboard.

  2. Set up an HTTP server with an endpoint to listen for POST requests from the Extracta.ai's API.

  3. Validate the incoming requests using the provided signature in the headers to ensure they are from Extracta.ai.

  4. Once validated, process the data sent by the webhook as needed.

Using webhooks is generally more efficient than polling, as it eliminates the need for repeated requests and provides real-time updates as soon as the batch processing is complete. However, setting up a webhook requires you to have a publicly accessible URL and handle the security for verifying incoming requests.

PreviousReceiving Batch ResultsNextHow to use the Webhook

Last updated 1 year ago

Was this helpful?