post https://app.butlerlabs.ai/api/queues//uploads
You can use this endpoint to upload files for processing. Uploading documents triggers an asynchronous extraction job.
Don't forget your uploadId!
You will use the returned
uploadId
to check the status of your extraction job, as well as get the extracted results. TheuploadId
is also used to delete the documents and results after if needed.
Generating extra results
The extraResults
query parameter will generate extra extraction results for documents uploaded to this asynchronous batch. Generating extra extraction results will make them available for querying.
The extra results you can generate include:
- FormFields: all Form Field values that are extracted from the document by Butler's general form field extraction
- Tables: all Table values that are extracted from the document by Butler's general table extraction algorithm
- LineBlocks: all Line Block values that are extracted from the document by Butler's general Line Block extraction algorithm
Here are example code snippets for how to use these additional parameters in your upload request:
# Include the extraResults param when making the request:
params = {
'extraResults': [ 'FormFields', 'Tables', 'LineBlocks' ]
}
upload_json = requests.post(
upload_url,
headers=auth_headers,
params=params,
files=files_to_upload
).json()
// Include the extraResults param when making the request:
const params = {
'extraResults': [ 'FormFields', 'Tables', 'LineBlocks' ]
};
const uploadResponse = await axios.post(
uploadUrl,
formData,
{
headers: {
...authHeaders,
...formData.getHeaders(),
},
params,
})
.catch((err) => console.log(err));
curl -X 'POST' \
'https://app.butlerlabs.ai/api/queues/<queue_id>/uploads?extraResults=LineBlocks&extraResults=FormFields&extraResults=Tables' \
-H 'accept: */*' \
-H 'Authorization: Bearer <api_key>' \
-H 'Content-Type: multipart/form-data' \
-F 'files=@<path_to_file>;type=<mime_type>'