Query File Recognition Results
Overview
The "Query File Recognition Results" API provided by DOCAI returns results in a standardized message format. The fieldList
defines key-value pairs in the Key-Value format for fields within the file, while the itemList
typically defines table fields. Different models calling the recognition interface may return different fields.
Request
POST https://api.docai.pro/api/identify/file/v2/identifyResult
Path parameters
Name | Type | Mandatory | Description |
---|---|---|---|
fileIdList | array | true | Unique identifier for uploading files |
modelId | string | true | The unique identifier of the model |
returnOcrResult | string | false | Whether to return OCR results,Default: 0,1: Returns OCR results,0: Does not return OCR results |
Response body
Name | Type | Mandatory | Description |
---|---|---|---|
fileId | string | true | Unique identifier for uploading files |
recognizeStatus | string | true | Upload file recognition status (0 - failed, 1 - successful, 2 - Identifying) |
result | object | true | Identification field |
result
Message Format
Name | Type | Mandatory | Description |
---|---|---|---|
fieldList | array | false | List of extracted fields from the document |
pageNumber | int | false | The page number within the document for this field |
key | string | false | The name of the extracted field |
value | string | false | The value of the extracted field |
itemList | array | false | Extracted line information from the document |
pageNumber | integer | false | The page number within the document for this item |
key | string | false | The name of the extracted item |
value | string | false | The value of the extracted item |
Example request
curl -i -X POST api.docai.pro/api/identify/file/v2/identifyResult \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DOCAI_API_KEY" \
-d '{"fileIdList":["2310091711378393918074800"],"modelId":"Your model Id"}'
Example response
{
"code": 200,
"message": null,
"costTime": null,
"data": [
{
"fileId": "2310091711378393918074800",
"recognizeStatus": "1",
"result": {
"fieldList": [
{
"pageNumber": 1,
"key": "paymentTerms",
"value": "Payment is due within 15 days"
},
{
"pageNumber": 1,
"key": "invoiceDate",
"value": "2019-02-11"
},
{
"pageNumber": 1,
"key": "documentType",
"value": "invoice"
},
{
"pageNumber": 1,
"key": "invoiceNumber",
"value": "US-001"
},
{
"pageNumber": 1,
"key": "grossAmount",
"value": "154.06"
},
{
"pageNumber": 1,
"key": "totalTax",
"value": "9.06"
},
{
"pageNumber": 1,
"key": "dueDate",
"value": "2019-02-26"
}
],
"taxList": [
[
{
"pageNumber": 1,
"key": "taxValue",
"value": "9.06"
},
{
"pageNumber": 1,
"key": "taxPercentage",
"value": "6.25"
}
]
],
"itemList": [
[
{
"pageNumber": 1,
"key": "totalPriceInclTax",
"value": "100.00"
},
{
"pageNumber": 1,
"key": "unitPrice",
"value": "100.00"
},
{
"pageNumber": 1,
"key": "quantity",
"value": "1"
},
{
"pageNumber": 1,
"key": "description",
"value": "Front and rear brake cables"
},
{
"pageNumber": 1,
"key": "totalPriceExclTax",
"value": "100.00"
}
],
[
{
"pageNumber": 1,
"key": "totalPriceInclTax",
"value": "30.00"
},
{
"pageNumber": 1,
"key": "unitPrice",
"value": "15.00"
},
{
"pageNumber": 1,
"key": "quantity",
"value": "2"
},
{
"pageNumber": 1,
"key": "description",
"value": "New set of pedal arms"
},
{
"pageNumber": 1,
"key": "totalPriceExclTax",
"value": "30.00"
}
],
[
{
"pageNumber": 1,
"key": "totalPriceInclTax",
"value": "15.00"
},
{
"pageNumber": 1,
"key": "unitPrice",
"value": "5.00"
},
{
"pageNumber": 1,
"key": "quantity",
"value": "3"
},
{
"pageNumber": 1,
"key": "description",
"value": "Labor 3hrs"
},
{
"pageNumber": 1,
"key": "totalPriceExclTax",
"value": "15.00"
}
]
]
}
}
],
"requestId": "da69edd3cb1d47b4a68db9303d280000",
"currentTimeMillis": 1696859401185
}