Data Extractions: Step-by-step
Learn how to streamline your workflows by extracting relevant values from PDF
Step 1: Upload your application form
The first step is to send the file to Herald. This can be accomplished using the [.h-endpoint-link]POST /files[.h-endpoint-link] endpoint.
Note that this endpoint requires the request body to be formatted as [.h-code]multipart/form-data[.h-code] instead of [.h-code]application/json[.h-code].
Here is an example to demonstrate this using the [.h-code]curl[.h-code] utility:
The endpoint also takes an additional “type” field in the request body, which you can leave null
for this workflow
Retrieve the corresponding file id from the API response.
Example response:
Step 2: Create a data extraction
Create a data extraction from the uploaded file via [.h-endpoint-link]POST /data_extractions[.h-endpoint-link] endpoint.
Example request:
You should expect a response that looks like the following, where status is pending
and parameter values are null
. This response indicates that your file is being processed.
Example response:
Step 3: Get your extraction results
Once the data extraction has been processed (expect <15s wait time), you can send a request to [.h-endpoint-link]GET /data_extractions/{data_extraction_id}[.h-endpoint-link] with the extraction_id to retrieve results. This can be accomplished either via polling intermittently for asynchronous updates or listening on webhooks.
The response body should include the set of risk and coverage values that have been extracted based on all applicable information in the PDF.
Example response:
[Optional] View all extractions associated with a file
In the event you created multiple extractions on the same file object (for example, when you were unsatisfied with the results from an earlier extraction), you have the option to review all historical extractions associated with a file by querying the [.h-endpoint-link]GET /data_extractions[.h-endpoint-link] endpoint with a file id.
If you expect a large number of extractions associated with the file, you can also include a limit
and a page
parameter in the request to specify requirements for pagination.
[Optional] Simulate pre-fill workflow in HeRB
You can also test the above workflow in HeRB by clicking the “Extract data from a file” link.