# Get document version

Get document version. The document can be Feishu document or spreadsheet. The version information includes the version title, version ID, version creator, create time, and more.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/drive/v1/files/:file_token/versions/:version_id
HTTP Method | GET
Rate Limit | [1000 per minute、50 per second](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.**<br>Enable any scope from the list | View, create, and delete document versions(drive:drive:version)<br>View document versions(drive:drive:version:readonly)
Required field scopes | **Notice**：The response body of the API contains the following sensitive fields, and they will be returned only after corresponding scopes are added. If you do not need the fields, it is not recommended that you request the scopes.<br>Obtain user ID(contact:user.employee_id:readonly)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>or<br>`user_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer u-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)

### Path parameters

Parameter | Type | Description
---|---|---
file_token | string | document token. For how to get the document token, see [Docs overview](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN#08bb5df6).<br>**Example value**: "shtbcqqoXZJaKYrfN5IHQgabcef"
version_id | string | document version ID<br>**Example value**: "fnJfyX"

### Query parameters

Parameter | Type | Required | Description
---|---|---|---
obj_type | string | Yes | document version type<br>**Example value**: docx<br>**Optional values are**:<br>- docx：Upgraded Docs<br>- sheet：Spreadsheet
user_id_type | string | No | User ID categories<br>**Example value**: open_id<br>**Optional values are**:<br>- open_id：Identifies a user to an app. The same user has different Open IDs in different apps. [How to get Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid)<br>- union_id：Identifies a user to a tenant that acts as a developer. A user has the same Union ID in apps developed by the same developer, and has different Union IDs in apps developed by different developers. A developer can use Union ID to link the same user's identities in multiple apps.[How to get Union ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id)<br>- user_id：Identifies a user to a tenant. The same user has different User IDs in different tenants. In one single tenant, a user has the same User ID in all apps （including store apps）. User ID is usually used to communicate user data between different apps. [How to get User ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id)<br>**Default value**: `open_id`<br>**When the value is `user_id`, the following field scopes are required**:<br>Obtain user ID(contact:user.employee_id:readonly)

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | version | \-
name | string | title
version | string | version ID
parent_token | string | Parent document token.
owner_id | string | document version owner ID
creator_id | string | document version creator ID
create_time | string | document version create time. Unix timestamp in seconds.
update_time | string | document version update time
status | string | document version status<br>**Optional values are**:<br>- 0：exist status<br>- 1：deleted status<br>- 2：trash status
obj_type | string | document version type<br>**Optional values are**:<br>- docx：Upgraded Docs<br>- sheet：Spreadsheet
parent_type | string | parent document token<br>**Optional values are**:<br>- docx：Upgraded Docs<br>- sheet：Spreadsheet

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "name": "Project document verion 1",
        "version": "fnJfyX",
        "parent_token": "doxbcyvqZlSc9WlHvQMlSJabcef",
        "owner_id": "694699009591869450",
        "creator_id": "694699009591869451",
        "create_time": "1660708537",
        "update_time": "1660708537",
        "status": "0",
        "obj_type": "docx",
        "parent_type": "docx"
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
403 | 1068400 | Has no permission, please apply the file permission of reading or edition. | Please apply the file permission of reading or edition.
404 | 1068404 | Parent file does not exist, please check the file status. | Please check the file status.
400 | 1068410 | Params error, param [file_token] is wrong. | Please check the `file_token` param.
400 | 1068411 | Params error, param [obj_type] is wrong. | Please check the `obj_type` param.
400 | 1068412 | Params error, param [version_id] is wrong. | Please check the `version_id` param.
400 | 1068425 | Request failed, please contact the engineer-https://applink.feishu.cn/TLJsX982. | Please contact technical support.
404 | 1068403 | File does not exist, please check the file status. | Please check the document version status.

