- Create a new submission,
- Upload files or raw data to that submission,
- Start the Heron workflow processing for that submission, and
- Retrieve the parsed data from files in the submission.
Create 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/v2 endpoint as a multipart/form-data request with the file attached. The file_class may be omitted, in which case Heron will classify the file based on its contents.
Starting Heron Workflow Processing
Once all files for a given submission have been uploaded, you can start the Heron workflow processing by sending a POST request to the/end_users/{heron_id}/start_workflow endpoint. This will trigger Heron to start processing the files in the submission and extracting data from them.
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.