# Document data structure

Document represents the Upgraded Docs. The hierarchical content that can form a tree-like relationship between multiple blocks. From the structural point of view, the Upgraded Docs is a block tree, which is called Document in OpenAPI.Document represents an online document created by the user in Feishu Docs. Each document has a unique `document_id` as its identifier. From the structural perspective, each document consists of multiple blocks arranged in a parent-child relationship, ultimately forming a block tree.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/9f5fdc25d4172bbf3cb312405c799fe7_jsNZJ2nRg5.png?height=1981&lazyload=true&width=3164)

## Data structure

The basic metadata structure of a document is as follows. You can obtain this information by calling the [Obtain the basic information of a document](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/get) API. To understand block structure within the document, refer to [Block data structure](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/data-structure/block).

```json
"document": {
    "document_id": string, // The unique identifier of the document.
    "revision_id": int,   // The identifier for the document version, which can be used to query or update a particular document version.
    "title": string, // The title of the document.
    "display_setting": { // The display setting of the document.
        "show_authors": boolean, // Whether the author is displayed in the document details.
        "show_comment_count": boolean, // Whether the total number of comments is displayed in the document details.
        "show_create_time": boolean, // Whether the creation time is displayed in the document details.
        "show_like_count": boolean, // Whether the total number of likes is displayed in the document details.
        "show_pv": boolean, // Whether the pv is displayed in the document details.
        "show_uv": boolean // Whether the uv is displayed in the document details.
    },
    "cover": {  // The cover of the document.
        "token": string, // Image token
        "offset_ratio_x": float, // The view's horizontal offset ratio.
        "offset_ratio_y": float // The view's vertical offset ratio.
    }
}
```

## Parameter description

The descriptions of the parameters in the above structure are as follows:

<b>Parameter name | <b>Data type | <b>Required | <b>Example value | <b>Description
---|---|---|---|---
document_id | string | required | TLLKdcpDro9ijQxA33ycNMabcef | The unique identifier of the document, which is also the ID of the corresponding page block for this document. To learn how to obtain `document_id`, refer to [Document overview](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-overview).
revision_id | int | required | 378 | The identifier of the document version, specifying the version to query or update. Editing or commenting on the document will change the `revision_id`.<br>The range for this parameter is: -1 or 0 < revision_id <= The latest version ID. -1 indicates the latest version of the document. Once the document is created, the document_revision_id is 1. <br>**Note**: A change in `revision_id` usually means a document update, but it may not necessarily be a change in document content; it could also be due to comments from others.
title | string | required | Weekly Report | The document title, supporting only plain text.
display_setting | object | optional | &nbsp; | The document display settings.
display_setting.show_authors | boolean | required | true | Whether the author is displayed in the document details.
display_setting.show_create_time | boolean | required | true | Whether the creation time is displayed in the document details.
display_setting.show_pv | boolean | required | false | Whether the pv is displayed in the document details.
display_setting.show_uv | boolean | required | false | Whether the uv is displayed in the document details.
display_setting.show_like_count | boolean | required | false | Whether the total number of likes is displayed in the document details.
display_setting.show_comment_count | boolean | required | false | Whether the total number of comments is displayed in the document details.
cover | object | optional | &nbsp; | The document cover
cover.token | string | required | D6d9bkdH7onNylxKyvucm8abcef | Image token
cover.offset_ratio_x | float | required | 0 | The view's horizontal offset ratio. The value is calculated as the horizontal offset distance in pixels from the center of the original image divided by the width of the original image in pixels. When the view is centered on the original image, this value is 0; when the view is on the right part of the original image, this value is positive; when the view is on the left part of the original image, this value negative. The default value is 0.
cover.offset_ratio_y | float | required | 0 | The view's vertical offset ratio. The value is calculated as the vertical offset distance in pixels from the center of the original image divided by the height of the original image in pixels. When the view is centered on the original image, the value is 0; when the view is on the upper part of the original image, the value is positive; when the view is on the lower part of the original image, the value is negative. The default value is 0.

