The document parsing operation is used to extract the key content of a document and extract the key-value information from the document based on the preset key-value template. The document parsing operation is an asynchronous operation. You need to call the asynchronous submission service for document parsing and then call the GetDocumentAnalyzeResult operation to perform result polling. The asynchronous submission service supports two methods: local files and URL files. Call the SubmitDocumentAnalyzeJob operation to upload URL files. Call the SubmitDocumentAnalyzeJobAdvance operation to upload local files.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| energy:SubmitDocumentAnalyzeJob | none | *All Resources * |
| none |
Request syntax
POST /api/v1/aidoc/document/submitDocumentAnalyzeJob HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| fileUrl | string | No | Choose one between fileUrl and fileUrlObject:
Note
Relationship between file parsing methods and supported document types.
| https://example.com/example.pdf |
| fileName | string | Yes | The filename must include the file type extension. | example.pdf |
| templateId | string | Yes | The unique extraction template ID is used to specify the key-value pairs to be extracted from the document. You need to log in to the template management page to configure the template and obtain the corresponding template ID. | templateCode |
| folderId | string | Yes | Unique knowledge base folder ID, used for categorizing documents and controlling the scope of online Q&A queries. If empty, the document will be uploaded to the tenant's root directory. | folderCode |
| analysisType | string | Yes | The default extraction method is "doc", with the following optional values:
| doc |
Response parameters
Examples
Sample success responses
JSONformat
{
"requestId": "4A0AEC56-5C9A-5D47-93DF-7227836FFF82",
"data": {
"jobId": "adkc-kk2k41-kk2ol-222424"
}
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2024-10-22 | The request parameters of the API has changed | View Change Details |
| 2024-09-23 | The request parameters of the API has changed | View Change Details |
| 2024-06-14 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
| 2024-06-07 | The request parameters of the API has changed | View Change Details |
