Submit a parsing task
Updated at:
Submit a document or audio/video parsing task; returns a biz_id for async queries
Submit a document or audio/video parsing task and get a biz_id in return. Document parsing is an async task: submit the file to obtain a biz_id, then use that ID to call Query the parsing result to get the processing status and result.
NoteMake sure you have obtained an API Key before calling. See Authentication.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
file_url | string | Yes | The URL of the file to parse. |
file_name | string | No | The file name. The protocol also provides file_name_extension; choose one of the two based on how you provide the file information. |
file_name_extension | string | No | The file type. Mutually exclusive with file_name. |
config_id | string | No | The configuration ID, for example config_xxx. When passed together with inline parameters, the inline parameters take precedence. |
processing | object | No | Processing configuration. |
processing.user_prompt | string | No | User-defined prompt. |
processing.doc_processing_config | object | No | Document parsing processing configuration. |
processing.doc_processing_config.page_index | string | No | The page range to parse, for example 1-10. |
processing.doc_processing_config.head_foot | boolean | No | Whether to parse headers and footers. |
processing.doc_processing_config.layout_position | boolean | No | Whether to return coordinates. |
processing.doc_processing_config.image_caption | boolean | No | Whether to generate image descriptions. |
processing.media_processing_config | object | No | Audio/video parsing processing configuration. |
processing.media_processing_config.enable_diarization | boolean | No | Whether to perform speaker diarization. |
processing.media_processing_config.enable_synopsis_parse | boolean | No | Whether to perform synopsis parsing. |
processing.media_processing_config.enable_synopsis_segments | boolean | No | Whether to generate synopsis segments. |
processing.media_processing_config.enable_synopsis_summary | boolean | No | Whether to generate a synopsis summary. |
processing.media_processing_config.frame_extraction | object | No | Frame extraction configuration. |
processing.media_processing_config.frame_extraction.mode | string | No | Frame extraction mode. Valid values: auto, frame_rate |
processing.media_processing_config.frame_extraction.frame_rate | number | No | Frame extraction rate, in the range 0.2–5 |
processing.media_processing_config.frame_extraction.output_image_width | integer | No | Output frame image width. If not specified, the original resolution is used. Value range: [32, 4096] |
processing.media_processing_config.frame_extraction.output_image_height | integer | No | Output frame image height. If not specified, the original resolution is used. Value range: [32, 4096] |
output | object | No | Output configuration. |
output.output_file_format | string[] | No | Array of output format strings. Valid values: markdown |
output.layout_table_format | string | No | Output format of tables in Markdown. Valid values: markdown, html |
output.oss_config | object | No | OSS output configuration. |
output.oss_config.bucket | string | No | Managed OSS bucket name. |
output.oss_config.endpoint | string | No | Managed OSS endpoint. |
output.oss_config.access_key_id | string | No | Managed OSS AccessKey ID. |
output.oss_config.access_key_secret | string | No | Managed OSS AccessKey Secret. |
output.oss_config.security_token | string | No | Managed OSS Security Token. |
Response
| Field | Type | Description |
|---|---|---|
request_id | string | The request ID |
data.biz_id | string | The business task ID, used to call /parse/result |
Document parsing code examples
The following examples show the two ways of defining processing. When config_id and processing are both present, processing takes precedence. The URLs, task IDs, and configuration IDs in the examples are desensitized placeholder values.
Use a saved configuration
curl -X POST 'https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/parse-x/parse/submit' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"file_url": "https://example.com/document.pdf",
"file_name": "document.pdf",
"config_id": "config_xxx"
}'
{
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"data": {
"biz_id": "parseX-2026xxxx-xxxxxxx"
}
}
Use inline configuration
curl -X POST 'https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/parse-x/parse/submit' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"file_url": "https://example.com/document.pdf",
"file_name": "document.pdf",
"processing": {
"doc_processing_config": {
"page_index": "1-10",
"head_foot": false,
"layout_position": true
}
},
"output": {
"output_file_format": [
"markdown"
],
"layout_table_format": "markdown"
}
}'
{
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"data": {
"biz_id": "parseX-2026xxxx-xxxxxxx"
}
}
Audio/video parsing code examples
Use a saved configuration
curl -X POST 'https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/parse-x/parse/submit' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"file_url": "https://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/static/Wan3.0模型创意视频.mp4",
"file_name": "test.mp4",
"config_id": "config_xxx"
}'
{
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"data": {
"biz_id": "parseX-Video-2026xxxx-xxxxxxx"
}
}
Use inline configuration
curl -X POST 'https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/parse-x/parse/submit' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"file_url": "https://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/static/Wan3.0模型创意视频.mp4",
"file_name": "test.mp4",
"processing": {
"media_processing_config": {
"enable_diarization": true,
"enable_synopsis_parse": true,
"enable_synopsis_segments": true,
"enable_synopsis_summary": true,
"frame_extraction": {
"mode": "auto",
"output_image_width": 1024,
"output_image_height": 1024
}
}
}
}'
{
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"data": {
"biz_id": "parseX-Video-2026xxxx-xxxxxxx"
}
}
ImportantAfter submitting, use Query the parsing result to poll the task status and get the parsing result.
Is this page helpful?