Use the dynamic file operation APIs to retrieve information about processed files. Agent applications can use these APIs to inject file data into the Dynamic Document Parsing tool using the parameters.agent_options.session_files parameter in your API calls.
File upload credential
Obtain a temporary dynamic file upload credential for subsequent document parsing operations.
Request syntax
Request parameters
Parameter | Type | Required | Description |
|---|---|---|---|
input | object | Yes | The input field. |
input.request_id | string | No | A custom request ID for your business. |
input.file_name | string | Yes | The name of the file to upload. |
input.file_md5 | string | Yes | The MD5 hash of the file to upload. |
input.file_size | int | Yes | The size of the file to upload. |
parameters | object | Yes | Configuration parameters. Leave this empty {} for this API. |
Response parameters
Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Yes | The status code. A value of 200 indicates success. |
message | string | Yes | The status message. |
output | object | Yes | The output field. |
output.request_id | string | No | A custom request ID for your business. |
output.result | object | Yes | The file processing result. |
output.result.headers | map[str, str] | Yes | The header information for uploading the file. |
output.result.lease_id | string | Yes | The credential ID. |
output.result.pre_signed_url | string | Yes | The pre-signed URL for Object Storage Service (OSS). |
Examples
Request example
Response example
Upload a file
You can upload the file from your client. The following code shows how to upload a file using the file upload credential.
Submit a file for parsing
After you upload the temporary dynamic file, you can submit the document for parsing using the file upload credential.
Request syntax
Request parameters
Parameter name | Type | Required | Description |
|---|---|---|---|
input | object | Yes | The input field. |
input.request_id | string | No | A custom request ID for your business. |
input.lease_id | str | Yes | The credential ID of the uploaded file. |
parameters | object | Yes | Configuration parameters. Leave this empty {} for this API. |
Response parameters
Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Yes | The status code. A value of 200 indicates success. |
message | string | Yes | The status message. |
output | object | Yes | The output field. |
output.request_id | string | No | A custom request ID for your business. |
output.result | array<object> | Yes | The file processing result. |
output.result.file_id | string | Yes | The ID of the file submitted for parsing. |
Examples
Request example
Response example
Get parsing status
After you submit a temporary dynamic file for parsing, you can query the parsing status using the file ID.
Request syntax
Request parameters
Parameter | Type | Required | Description |
|---|---|---|---|
input | object | Yes | The input field. |
input.request_id | string | No | A custom request ID for your business. |
input.file_ids | list[str] | Yes | A list of file IDs submitted for parsing. |
parameters | object | Yes | Configuration parameters. Leave this empty {} for this API. |
Response parameters
Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Yes | The status code. A value of 200 indicates success. |
message | string | Yes | The status message. |
output | object | Yes | The output field. |
output.request_id | string | No | A custom request ID for your business. |
output.result | array<object> | Yes | The file processing result. |
output.result.[0].status | string | Yes | The processing status of the file submitted for parsing. |