Data Extractions: Step-by-step
Learn how to streamline your workflows by extracting relevant values from files
Step 1: Upload your application form
The first step is to send the files 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:
Repeat this for all files for which you wish to extract values from. One data_extraction can accept multiple files, and files can be reused for multiple separate extractions in any combination.
Step 2: Create a data extraction
Create a data extraction indicating the desired uploaded files using the field file_ids included in the [.h-endpoint-link]POST /data_extractions[.h-endpoint-link] endpoint. Optionally include the context field to indicate any relevant context for the data extraction. In this example we are specifying the line of business for which we wish to extract parameters
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 files are being processed.
Example response:
Step 3: Get your extraction results
Once the data extraction has been processed (expect ~30s 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 will include the set of risk and coverage values that have been extracted based on applicable information contained in the files.
Example response:
Now you are ready to apply your extracted values to an application! Visit the applications data extractions page to learn more about applying extracted values to an application.
[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 pageparameter in the request to specify requirements for pagination.