Extracts key information from a document based on a preset key-value template or prompt template. A successful call returns a task ID. You can then call GetDocExtractionResult to retrieve the extraction results. This operation asynchronously submits a task for a file specified by a URL. To submit a task for a local file, use the SubmitDocExtractionTaskAdvance operation.
Try it now
Test
RAM authorization
Request syntax
POST /api/v2/aidoc/document/submitDocExtractionTask HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| fileUrl |
string |
No |
Choose one of the following parameters: fileUrl or fileUrlObject.
Note
The supported document types vary based on the extraction method.
|
fileUrl:https://example.com/example.pdf fileUrlObject:本地文件生成的FileInputStream |
| fileName |
string |
Yes |
The file name, including the file extension. |
example.pdf |
| templateId |
string |
Yes |
The unique ID of the extraction template. This ID specifies the content to extract from the document. To obtain a template ID, log on to the template management page and configure a template. |
572d24k0c95a |
| folderId |
string |
Yes |
|
xxxxx |
| extractType |
string |
Yes |
The document extraction type. Supported types include rag and long-text understanding. The default value is rag. |
rag |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response schema. |
||
| requestId |
string |
The request ID. |
83A5A7DD-8974-5769-952E-590A97BEA34E |
| data |
object |
The returned data. |
|
| taskId |
string |
The task ID. |
864773ec-d35b-4c36-8871-52d07fbe806d |
Examples
Success response
JSON format
{
"requestId": "83A5A7DD-8974-5769-952E-590A97BEA34E",
"data": {
"taskId": "864773ec-d35b-4c36-8871-52d07fbe806d"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.