In Heron, files are grouped together into submissions (also called end users), a submission represents data relating to a single party in your workflow, such as applicant business, plaintiff, etc.

This guide will walk you through the process of creating a new submission using the Heron API, uploading files to that submission, and retrieving the parsed data from files in the submission.

Creating a New Submission

Creating a new submission requires sending a POST request to the /end_users endpoint.

The request body should include the end_user_id of the submission which should be a unique reference to the submission in your system. You may also include a name field to give the submission a human-readable name.

Upload Files to a Submission

Now we’ve created a new submission to hold our files, we can upload files to it and start extracting data from them.

To upload a file to a submission, send a POST request to the /end_users/{heron_id}/files endpoint, providing a base64-encoded file, the file class, and the filename. The file class may be omitted, in which case Heron will classify the file based on its contents.

Retrieve Parsed Data from Uploaded Files

Now we’ve uploaded a file, we can poll the /end_users/{end_user_id_or_heron_id}/files endpoint to retrieve the parsed data from files in the submission.

The response body will be an array of files in the submission, and will contain a parsed_results array for each file. This array will contain the extracted data from the file and and a parsing_status field indicating the status of the parsing process, you should continue to poll this endpoint until the parsing status is either succeeded or failed.