Help Center/ Cloud Search Service_KooSearch/ API Reference/ API/ Outdated APIs/ Document parsing/ Querying the result of an asynchronous document parsing task
Updated on 2025-08-13 GMT+08:00

Querying the result of an asynchronous document parsing task

Function

Querying an Asynchronous Document Parsing Task

URI

GET /v1/koosearch/doc-search/tasks/{task_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

task_id

Yes

String

Details:

ID of a document parsing task. You can use this ID to query the document parsing status and parsing result.

Constraints:

It can contain 4 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter.

Default value:

N/A.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Parameter description:

Token used for API authentication. For how to obtain the token, see section 3.2 "Authentication."

Constraints:

N/A.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

task_status

String

Parsing task status. success indicates success, error indicates failure, and pending indicates processing.

task_desc

String

Task description, mainly the information when the task fails

result

ParsedDocument object

Document parsing result. This field is contained only when the parsing is successful.

Table 4 ParsedDocument

Parameter

Type

Description

doc_id

String

Document ID, which is generated based on the UUID

doc_name

String

Document

doc_type

String

Document type, for example, PDF or DOCX

preview_file_url

String

Preview file address

original_file

String

Original document path

file_size

Integer

Original document size, in bytes

pages

Array of ParsedDocumentPage objects

Document page information

images

Array of ParsedDocumentImage objects

Document image information

original_tables

Array of OriginalTable objects

Original table information

Table 5 ParsedDocumentPage

Parameter

Type

Description

page_num

Integer

Page number, which indicates the sequence number of a page in the document

preview_image_url

String

Address of the document page preview image

components

Array of ParsedDocumentComponent objects

Paragraph information on the page

Table 6 ParsedDocumentComponent

Parameter

Type

Description

id

String

Paragraph ID, which is generated based on the UUID

text

String

Paragraph Content

component_num

Integer

Paragraph code, which indicates the sequence number of a paragraph in the document. The value starts from 1.

pdf_coordinate

Array<Array<Integer>>

Coordinates of a paragraph on the page, corresponding to the upper left, upper right, lower right, and lower left, respectively, for highlighting

original_table_id

String

This parameter has a value only when the table is split. It is used to save the original long table to support the small2big feature.

Table 7 ParsedDocumentImage

Parameter

Type

Description

image_id

String

Image ID, which is the prefix img- and UUID

url

String

Path for uploading the image to OBS

data

String

Base64-encoded image data

title

String

Image title

desc

String

Image description

width

Integer

Image width,

height

Integer

Image height.

Table 8 OriginalTable

Parameter

Type

Description

id

String

Table ID. ParsedDocumentComponent will reference this identifier to avoid storing multiple copies.

content

String

Form content

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error description

Status code: 401

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error description

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error description

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

Result of the asynchronous document parsing task

400

Invalid request parameters

401

Authentication error

500

Service content error

Error Codes

See Error Codes.