Skip to main content

Import document for parsing

You can use the REST API to upload documents directly to DocumentPro. Once uploaded documents are parsed automatically and available for export from the portal or using the API

Guide to implementing API#

API Endpoint#

POST https://2sy6t3lcbd.execute-api.us-east-1.amazonaws.com/prod/files/upload/{parser_id}

Example Implementation using Python#

import requests
parser_id = "your_parser_id"url = f"https://2sy6t3lcbd.execute-api.us-east-1.amazonaws.com/prod/files/upload/{parser_id}"
payload = {}files=[  ('file',('filename.pdf', open('filepath/filename.pdf','rb'),'application/pdf'))]headers = {  'x-api-key': 'API_KEY'}
response = requests.request("POST", url, headers=headers, data=payload, files=files)

# If the request was successful, status_code will be 200if response.status_code == 200:    print('File uploaded successfully')else:    print('Failed to upload file')

The API can upload up to 6mb file sizes.

The parser_id is the unique identifier for a parser. You can get copy it from the settings tab on a parser page.

Template settings

Response body#

A 200 status code will have the following body structure.

{  "request_id": "unique_identifier",  "success": true}

For status codes 400, 403 and 500 you will get the following response body.

{  "success": false,  "error": "error message"}