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

# 更新文件处理结果

> 更新文件处理结果。通常用于人工审核校对后，上传修改后的key-value，覆盖自动识别的结果。



## OpenAPI

````yaml /docflow/cn/rest-api/openapi.bundle.yaml post /api/app-api/sip/platform/v2/file/update
openapi: 3.0.0
info:
  title: DocFlow API
  description: DocFlow REST API，提供文件上传和获取文件处理结果能力
  version: 2.8.4
servers:
  - url: https://docflow.textin.com
security:
  - ApiId: []
    SecretCode: []
paths:
  /api/app-api/sip/platform/v2/file/update:
    post:
      summary: 更新文件处理结果
      description: 更新文件处理结果。通常用于人工审核校对后，上传修改后的key-value，覆盖自动识别的结果。
      operationId: updateFile
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  workspace_id:
                    type: string
                    description: 空间ID
                    example: 1234567890
                  file_id:
                    type: string
                    description: 文件ID
                    example: 202412190001
                  data:
                    description: |
                      全量更新字段。  
                      注意，即使只更新部分字段，也必须包含所有字段。  
                      如果传入的字段较原字段多，则多出的字段会被添加。  
                      如果传入的字段较原字段少，则缺少的字段会被删除。  
                      如果传入的字段值较原字段值有变化，则字段值会被更新。  
                      如果传入的字段与原字段完全相同，则字段会被保留。
                    type: object
                    properties:
                      fields:
                        type: array
                        items:
                          $ref: '#/components/schemas/KeyValue'
                        example:
                          - key: 发票代码
                            value: '3100231130'
                            position:
                              - page: 0
                                vertices:
                                  - 0
                                  - 0
                                  - 100
                                  - 0
                                  - 100
                                  - 100
                                  - 0
                                  - 100
                          - key: 发票号码
                            value: '28737000'
                            position:
                              - page: 0
                                vertices:
                                  - 0
                                  - 0
                                  - 100
                                  - 0
                                  - 100
                                  - 100
                                  - 0
                                  - 100
                      items:
                        type: array
                        items:
                          type: array
                          items:
                            $ref: '#/components/schemas/KeyValue'
                        example:
                          - - key: 货物劳务名称
                              value: ＊电子计算机＊微型计算机主机
                              position:
                                - page: 0
                                  vertices:
                                    - 0
                                    - 0
                                    - 100
                                    - 0
                                    - 100
                                    - 100
                                    - 0
                                    - 100
                            - key: 规格型号
                              value: DMS-SC68
                              position:
                                - page: 0
                                  vertices:
                                    - 0
                                    - 0
                                    - 100
                                    - 0
                                    - 100
                                    - 100
                                    - 0
                                    - 100
                          - - key: 货物劳务名称
                              value: ＊机械计算机＊巨型计算机主机
                              position:
                                - page: 0
                                  vertices:
                                    - 0
                                    - 0
                                    - 100
                                    - 0
                                    - 100
                                    - 100
                                    - 0
                                    - 100
                            - key: 规格型号
                              value: AN/FSQ-7
                              position:
                                - page: 0
                                  vertices:
                                    - 0
                                    - 0
                                    - 100
                                    - 0
                                    - 100
                                    - 100
                                    - 0
                                    - 100
                required:
                  - workspace_id
                  - file_id
                  - data
      responses:
        '200':
          description: 成功更新文件处理结果
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CodeMessage'
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          files:
                            description: 更新后的文件列表
                            type: array
                            items:
                              type: object
                              properties:
                                workspace_id:
                                  type: string
                                  description: 空间ID
                                  example: 1234567890
                                id:
                                  type: string
                                  description: 文件ID
                                  example: 202412190001
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            curl -X POST \

            -H 'x-ti-app-id: 1234567890' \

            -H 'x-ti-secret-code: 1234567890' \

            -d '[{"workspace_id": "1234567890", "file_id": "202412190001",
            "data": {"fields": [{"key": "发票代码", "value": "3100231130"}]}}]' \

            'https://docflow.textin.com/api/app-api/sip/platform/v2/file/update'
components:
  schemas:
    KeyValue:
      type: object
      properties:
        key:
          type: string
          description: 字段名
        value:
          type: string
          description: 字段值
        position:
          $ref: '#/components/schemas/KeyValuePosition'
    CodeMessage:
      type: object
      properties:
        code:
          type: integer
          description: 状态码
          example: 200
        msg:
          type: string
          description: 状态描述
      required:
        - code
        - msg
    KeyValuePosition:
      description: 字段值的位置。字段值可能跨页或跨行，因此用数组展示。
      type: array
      items:
        type: object
        properties:
          page:
            type: integer
            description: 字段所在页。是`pages`数组的索引
          vertices:
            type: array
            description: >-
              字段值的外接四边形坐标。图像以左上为原点，数组值为 [左上角x, 左上角y, 右上角x, 右上角y, 右下角x, 右下角y,
              左下角x, 左下角y]
            items:
              type: integer
            minItems: 8
            maxItems: 8
  securitySchemes:
    ApiId:
      type: apiKey
      in: header
      name: x-ti-app-id
    SecretCode:
      type: apiKey
      in: header
      name: x-ti-secret-code

````