# Obtain metadata of a documentwarning 
This API does not support the Upgraded Docs whose type is `docx`. If you need to obtain the metadata in an Upgraded Docs, call [Obtain Metadata](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/meta/batch_query).

This API is used to obtain metadata based on a docToken.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/doc/v2/meta/:docToken
HTTP Method | GET
Required scopes<br>**The scopes required to call this API. You can call the API with any of the scopes.**<br>Enable any scope from the list | View, comment, edit, and manage all files in My Space<br>View, comment, and download all files in My Space<br>View the metadata of files in My Space<br>View, comment, edit, and manage Docs<br>View, comment, and export Docs

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `user_access_token` or `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer u-7f1bcd13fc57d46bac21793a18e560"<br>[Learn more about how to access and use access_token](https://open.feishu.cn/document/ukTMukTMukTM/uMTNz4yM1MjLzUzM)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

For more information about how to call the AccessToken in the Docs API, see [Get started with the Docs API](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN).
<br>
### Path parameters
|Parameter|Type|Required|Description|
|--|-----|--|----|----|
|docToken|string|Yes|Document token. For more information about how to obtain the token, see [How to get the token of docs resources](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN#036e0b0f).|

### Curl request demo
```
curl -H 'Authorization: Bearer u-s12okJw4R1VCZLWhk9Zyzg' 'https://open.feishu.cn/open-apis/doc/v2/meta/doccnilYPZU5b34ow4ca7aNoU6a' 
```

## Response
### Response body
|Parameter|Type|Description|
|--|--|--|
|create_date|string|Creation date|
|create_time|integer|Creation timestamp|
|creator|string|Creator open_id|
|create_user_name|string|Creator username|
|delete_flag|integer|Deletion flag, 0 indicates normal access and not deleted, 1 indicates the object is in the trash, 2 indicates the object is permanently deleted|
|edit_time|integer|Last edit timestamp|
|edit_user_name|string|Username of last editor|
|is_external|bool|Whether it is an external document|
|is_pined|bool|Whether it is a quick access in the API caller directory |
|is_stared|bool|Whether it is a favorite in the API caller directory |
|is_upgraded|bool|Whether the document has been upgraded<br>For details on the differences between the old and upgraded documents, see: [Document version changes](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/docs/upgraded-docs-access-guide/upgraded-docs-openapi-access-guide)<br>For details on how to access the new version of the document, see: [Document overview](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-overview)<br>**Default value:** false|
|obj_type|string|Document type, always "doc"|
|owner|string|open_id of the current owner|
|owner_user_name|string|Username of the current owner|
|server_time|integer|Server timestamp during request processing|
|tenant_id|string|ID of the tenant of the document |
|title|string|Document name|
|type|integer|Document type, always "2"|
|upgraded_token|string|The upgraded document token corresponds to `document_id` in the upgraded document api<br>**Example value:** AcJ3d2QM1onnE4xjcZAcP7abcef|

|url|string|Document URL|

### Response body example
```json
{
    "code": 0,
    "msg": "Success",
    "data": {
        "create_date": "20240808",
        "create_time": 1723088043,
        "creator": "ou_f700228a5386f25bc0e61135066abcef",
        "create_user_name": "ZhangSan",
        "delete_flag": 0,
        "edit_time": 1723088073,
        "edit_user_name": "ZhangSan",
        "is_external": false,
        "is_pined": false,
        "is_stared": false,
        "is_upgraded": true,
        "obj_type": "doc",
        "owner": "ou_f700228a5386f25bc0e61135066abcef",
        "owner_user_name": "ZhangSan",
        "server_time": 1723089073,
        "tenant_id": "42",
        "title": "Project Management",
        "type": 2,
        "upgraded_token": "AcJ3d2QM1onnE4xjcZAcP7abcef",
        "url": "https://example.feishu.cn/docs/doccnilYPZU5b34ow4ca7aabcef"
    }
}
```

### Error code

Error code | Description | Troubleshooting suggestions
---|---|---
91401 | PARAMERR | Check parameter validity
91402 | NOTEXIST | Check if the token is valid
91403 | FORBIDDEN | Check for document read permissions
91404 | LOGIN_REQUIRED | Need to log in
95001 | internal error | Internal error, please try again later.
95003 | internal error | Internal error, please try again later.
95005 | internal error | Internal error, please try again later.
95006 | Failed | Check if the token is valid
95007 | Failed | Deleted file cannot get document meta information
95008 | FORBIDDEN | Check user's permission for doc and folder
95009 | Failed | Check for document read permissions. [Add permissions](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create)
95010 | internal error | Internal error, please try again later.
95011 | internal error | Internal error, please try again later.
95017 | Specific error message | Check if the revison is correct
95018 | Specific error message | See specific error messages for details
95023 | revision too old | The Revision is too old, Please use the latest version number
95024 | Failed | Check parameter validity
95053 | this API does not support the Upgraded Docs(docx), please refer to the https://feishu.feishu.cn/docx/ICI7dp1Uioh4EvxXn0HcxUapn0c using the correct API. | This API does not support the Upgraded Docs(docx), please refer to the [Document overview](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-overview) using the correct API.

For details, refer to [Server-side error codes](https://open.feishu.cn/document/ukTMukTMukTM/ugjM14COyUjL4ITN).
