> ## Documentation Index
> Fetch the complete documentation index at: https://adp-doc.laiye.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 查询文档抽取任务结果

> 根据创建任务接口返回的 task_id 查询文档抽取状态和结果。



## OpenAPI

````yaml /api-reference/adp-api.yaml get /open/agentic_doc_processor/{tenant_name}/v1/app/doc/extract/query/task/{task_id}
openapi: 3.1.0
info:
  title: ADP API
  version: 1.0.0
  description: Laiye ADP 官方 OpenAPI 接口规范，覆盖文档抽取、文档解析、抽取应用管理、积分查询、工作流运行和工作流文件管理。
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://adp.laiye.com
    description: ADP 生产环境
security: []
tags:
  - name: 文档抽取
    description: 从上传的文档中抽取结构化字段。
  - name: 文档解析
    description: 识别上传文档中的文字、版面块和位置信息。
  - name: 应用管理
    description: 创建、修改、删除和查询抽取应用及配置。
  - name: 账户
    description: 查询账户积分和使用情况。
  - name: 工作流
    description: 运行工作流应用并查询执行结果。
  - name: 工作流文件
    description: 上传和管理工作流应用使用的文件。
paths:
  /open/agentic_doc_processor/{tenant_name}/v1/app/doc/extract/query/task/{task_id}:
    get:
      tags:
        - 文档抽取
      summary: 查询文档抽取任务结果
      description: 根据创建任务接口返回的 task_id 查询文档抽取状态和结果。
      operationId: queryDocumentExtractTask
      parameters:
        - $ref: '#/components/parameters/TenantName'
        - $ref: '#/components/parameters/TaskId'
      responses:
        '200':
          $ref: '#/components/responses/DocumentExtractResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    TenantName:
      name: tenant_name
      in: path
      required: true
      description: 租户名称，默认 laiye。
      schema:
        type: string
        default: laiye
    TaskId:
      name: task_id
      in: path
      required: true
      description: 任务 ID。
      schema:
        type: string
  responses:
    DocumentExtractResponse:
      description: 文档抽取结果。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DocumentExtractResponse'
          example:
            code: success
            message: ''
            data:
              task_id: 94fe9b74e0e311f091505e345594c618
              file_url: ''
              status: 4
              doc_recognize_result: []
              extraction_result: []
    ValidationError:
      description: 参数校验错误。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleResponse'
  schemas:
    DocumentExtractResponse:
      allOf:
        - $ref: '#/components/schemas/SimpleResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/DocumentExtractData'
    SimpleResponse:
      type: object
      properties:
        code:
          oneOf:
            - type: string
            - type: integer
          description: 业务码。成功通常为 success 或 200。
        message:
          type: string
          description: 返回信息。
        tips:
          type:
            - string
            - 'null'
          description: 详细信息，默认为空。
    DocumentExtractData:
      type: object
      properties:
        task_id:
          type: string
        file_url:
          type: string
        status:
          type: integer
          description: 1=等待，2=解析中，3=抽取中，4=成功，5=失败。
        doc_recognize_result:
          type: array
          items:
            $ref: '#/components/schemas/RecognizePage'
        extraction_result:
          type: array
          items:
            $ref: '#/components/schemas/ExtractionField'
        collaboration_result:
          type: array
          items:
            type: object
            additionalProperties: true
        output_result:
          type: array
          items:
            type: object
            additionalProperties: true
    RecognizePage:
      type: object
      properties:
        page_num:
          type: integer
        document_content:
          type: string
        document_details:
          type: array
          items:
            $ref: '#/components/schemas/DocumentDetail'
        stamps:
          type: array
          description: 印章识别结果。仅在开启 enable_stamp_recognition 且识别到印章时返回。
          items:
            type: object
            additionalProperties: true
    ExtractionField:
      type: object
      additionalProperties: true
      properties:
        field_key:
          type: string
        field_name:
          type: string
        field_values:
          type: array
          items:
            type: object
            additionalProperties: true
        references:
          type: array
          items:
            type: object
            additionalProperties: true
        table_values:
          type: array
          items:
            type: array
            items:
              type: object
              additionalProperties: true
    DocumentDetail:
      type: object
      properties:
        type:
          type: string
        text:
          type: string
        position:
          type: array
          items:
            type: object
            properties:
              points:
                type: array
                items:
                  $ref: '#/components/schemas/Point'
        ocr_confidence:
          type: object
          properties:
            ocr_mean_confidence:
              type: number
            ocr_min_confidence:
              type: number
            is_overall_confidence:
              type: integer
    Point:
      type: object
      properties:
        x:
          type: number
        'y':
          type: number
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        生产环境的用户 OpenAPI Accessor access_key，在 ADP 平台的「我的 API」中查看。key
        被禁用、过期或不属于生产环境时会返回 Accessor not found。

````