Skip to content
Guides

Intelligent Document Extraction

Key Information Extraction - Sync

Extract key information fields and table information from documents. Supported file formats: PDF, JPG, JPEG, PNG.


Request method:

  • Request method: POST.

  • Parameter transfer method: Body (form-data).

Request address:

https://localhost:7000/idp/intelligent-document-extraction

Request parameters:

Parameter nameData typeDescriptionRequired
fileFileSource document.Yes
keysarray[string]Key information fields.No
tableHandlesarray[string]Table header fields.No
pagesarray[int]Specify page number to extract.No

When neither keys nor tableHandles exists, extract all key information in the file.

JSON content explanation

Return parameterData typeDescription
codeStringError code, "200" means success
messageStringError message
dataObjectReturn result
+detailsObjectKey information extraction result
++Page-indexObjectCorresponding page number extraction result
+++keyStringKey information field extraction result, key:value
+++tablesArrayKey information table extraction result, tables:[ [table1], [table2] ]

JSON structure example:

json
{
    "code": "200",
    "msg": "success",
    "data": {
        "details": {
            "Page-1": {
                "Order Date": "xxx",
                "Order #": "xxx",
                "Quote#": "xxx",
                "Your estimated delivery date is": "xxx",
                "tables": null
            }
        }
    }
}

Key Information Extraction - Async

Extract key information fields and table information from documents asynchronously. Supported file formats: PDF, JPG, JPEG, PNG.

Upload and submit files

Upload the file you need to process and get fileId

Request method:

  • Request method: POST.

  • Parameter transfer method: Body (form-data).

Request address:

https://localhost:7000/idp/async/intelligent-document-extraction

Request parameters:

Parameter nameData typeDescriptionRequired
fileFileSource document.Yes
keysarray[string]Key information fields.No
tableHandlesarray[string]Table header fields.No
pagesarray[int]Specified page number extraction.No

When both keys and tableHandles do not exist, extract all key information in the file.

JSON content explanation

Return parameterData typeDescription
codeStringError code, "200" means success
messageStringError message
dataObjectReturn result
+fileIdStringfileId

JSON structure example:

json
{
    "code": "200",
    "msg": "success",
    "data": {
        "fileId": "62132012acb86cf41ec9f6273f4026e8"
    }
}

Get processing results

Get the file processing results based on fileId.

If code or HTTP STATUS is 202, the file is being processed. Please call this interface later to get the file processing results.

Request method:

  • Request method: POST.
  • Parameter transfer method: Body (form-data).

Request address:

https://localhost:7000/idp/get-file-data-extract-result

Request parameters:

Parameter nameData typeDescriptionRequired or not
fileIdStringfileIdYes

JSON content explanation

Return parameterData typeDescription
codeStringError code, "200" means success
messageStringError message
dataObjectReturn result
+detailsObjectKey information extraction result
++Page-indexObjectCorresponding page number extraction result
+++keyStringKey information field extraction result, key:value
+++tablesArrayKey information table extraction results, tables:[ [table1], [table2] ]

JSON structure example:

json
{
    "code": "200",
    "msg": "success",
    "data": {
        "details": {
            "Page-1": {
                "Order Date": "xxx",
                "Order #": "xxx",
                "Quote#": "xxx",
                "Your estimated delivery date is": "xxx",
                "tables": null
            }
        }
    }
}

Error Code Reference

Return value:

Return parameterData typeDescription
codeStringError code.
msgStringError description.

Return example:

java
{
  "code": "08005",
  "msg": "Key information extraction failed."
}

Reference:

Error codeDescriptionSolution
'01001'System internal exception.Contact [email protected].
'01003'File upload error.Contact [email protected].
'03000'Parameter verification exception.Check file processing parameters, refer to API interface section.
'02321'PDF file does not exist.Contact [email protected].
'02002'File size is 0.Check whether the uploaded file is uploaded successfully.
'02004'File processing failed.Retry or contact [email protected].
'02006'File return error.Check whether the returned file is received normally or contact [email protected].
'01004'File upload exception.Contact [email protected].
'01005'File cannot be empty.Check whether the uploaded file is uploaded successfully.
'01203'File cannot be found or cannot be opened.Contact [email protected].
'02002'File conversion in this format is not supported.Contact [email protected].
'02207'File opening failed: file type is not supported or encrypted.Check whether the file has a protection password and whether the correct password parameter is passed in.
'04003'File does not exist or cannot be opened.Contact [email protected].
'07001'Current function is not supported.Contact [email protected].
'08100'Invalid license.Contact [email protected] to obtain the correct LicenseKey.
'08101'The license has expired.Contact [email protected] to obtain the correct LicenseKey.
'08102'The license does not support the current platform.Contact [email protected] to obtain the correct LicenseKey.
'08105'The license does not have the permission for this function.Contact [email protected] to obtain the correct LicenseKey.
'01006'File parameter abnormality: Please set the correct file parameters.Check whether the file parameters are correct.
'08002'The executor does not exist or cannot be usedCheck whether the executor is running normally
'08005'Key information extraction failed.Contact [email protected].

Status Code:

ComIDP uses HTTP status codes to return the results of your request. We mainly use two values ​​to inform you of the results of your request:

  • 200 — A response with a status code of 200 indicates that the API call was successful.

  • 413 — The API sends this status when your request size exceeds the limit.