API Tutorial
Try a webhook
For asynchronous extractions, you can retrieve extraction results using either API endpoints or a webhook. A webhook allows you to receive the extraction as a push, rather than waiting for responses from API endpoints.
For this tutorial, let’s try a webhook in combination with the /extract_from_url
endpoint. Note you can also use the webhook with the /generate_upload_url
endpoint and other asynchronous endpoints.
Prerequisites
See prerequisites.
Configure the webhook
- Generate a destination for the webhook: navigate to https://webhook.site/ to automatically create a unique test page:
Note: Use this website solely for testing. In production, make your own destination for the webhook payload.
- Copy the following code sample, and replace
YOUR_UNIQUE_URL
with your uniquely generated webhook.site URL:
- In your Postman workspace, click Import, select Raw text, paste the code sample, and follow the prompts to import to code sample.
- Click Send in Postman.
Check the webhook response
Visit your unique URL at webhook.site to verify there’s a response at the URL that includes parsed_document
and webhook
objects that look something like the following: