# Get a Global Comment

Obtains a specified global comment in Docs. Local comments are not supported yet.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/drive/v1/files/:file_token/comments/:comment_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, comment, edit, and manage Docs(docs:doc)<br>View, comment, and export Docs(docs:doc:readonly)<br>Get comments in document(docs:document.comment:read)<br>View, comment, edit, and manage all files in My Space(drive:drive)<br>View, comment, and download all files in My Space(drive:drive:readonly)<br>View, comment, edit, and manage Sheets(sheets:spreadsheet)<br>View, comment, and export Sheets(sheets:spreadsheet: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 | Token of the document<br>You can directly obtain the document Token by accessing the URL bar of the browser where the document is located.<br>**Example value**: "doccnHh7U87HOFpii5u5G*****"
comment_id | string | Comment ID<br>It can be obtained by calling the "Add Comment" and "Get Comment" interfaces.<br>**Example value**: "6916106822734578184"

### Query parameters

Parameter | Type | Required | Description
---|---|---|---
file_type | string | Yes | Type of the document<br>**Example value**: doc<br>**Optional values are**:<br>- doc：Doc<br>- sheet：Sheet<br>- file：File<br>- docx：New Doc
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)
need_reaction | boolean | No | Do we need to obtain the Reaction data attached to the comment card. The default value is false.<br>**Example value**: false

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | file.comment | \-
comment_id | string | Comment ID. This field can be left empty when you create a comment. If this field is specified, the comment is deemed as a reply to an existing comment.
user_id | string | User ID
create_time | int | Creation time(Unit: seconds)
update_time | int | Last update(Unit: seconds)
is_solved | boolean | Specifies whether the comment is solved.
solved_time | int | Time when the comment is solved
solver_user_id | string | User ID of the comment solver
has_more | boolean | Whether the response body has more parameters
page_token | string | Page identifier, when has_more is true, a new page_token will also be returned. Otherwise, page_token will not be returned
is_whole | boolean | Whether it is a full text comment(This interface does not return this parameter)
quote | string | The quote of document(This interface does not return this parameter)
reply_list | reply_list | List of replies in the comment
replies | file.comment.reply\[\] | Reply list
content | reply_content | Reply content
elements | reply_element\[\] | Reply content
type | string | Content elements of the reply<br>**Optional values are**:<br>- text_run：Plain text<br>- docs_link：Link to @mentioning a document in Docs<br>- person：Contact to @mention
text_run | text_run | Text content
text | string | Reply with plain text
docs_link | docs_link | Text content
url | string | @mentioned document in a reply.
person | person | Text content
user_id | string | @mentioned contact in a reply
reply_id | string | Reply ID
user_id | string | User ID
create_time | int | Creation time(Unit: seconds)
update_time | int | Last update(Unit: seconds)
extra | reply_extra | Store other type replies item
image_list | string\[\] | Image token list
reactions | file_comment_v2_batch_query_reaction_data\[\] | Comment on the corresponding emoji reply information on the reply card
reaction_key | string | The unique identifier for emoji replies, used to distinguish between different types of comment emojis (such as thumbs up, applause, etc.).
count | int | The cumulative usage count of this emoji reply is calculated based on the valid reply records of all users under the current comment.
ahead_users | string\[\] | Used to prioritize the display of core interactive users on the interface. User IDs can be obtained through the user information query interface.

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "comment_id": "6916106822734512356",
        "user_id": "ou_cc19b2bfb93f8a44db4b4d6eababcef",
        "create_time": 1610281603,
        "update_time": 1610281603,
        "is_solved": true,
        "solved_time": 1610281603,
        "solver_user_id": null,
        "has_more": true,
        "page_token": "6916106822734512356",
        "reply_list": {
            "replies": [
                {
                    "content": {
                        "elements": [
                            {
                                "type": "text_run",
                                "text_run": {
                                    "text": "comment text"
                                },
                                "docs_link": {
                                    "url": null
                                },
                                "person": {
                                    "user_id": null
                                }
                            }
                        ]
                    },
                    "reply_id": "6916106822734512356",
                    "user_id": "ou_cc19b2bfb93f8a44db4b4d6eab2abcef",
                    "create_time": 1610281603,
                    "update_time": 1610281603,
                    "extra": {
                        "image_list": [
                            "xfsfseewewabcef"
                        ]
                    },
                    "reactions": [
                        {
                            "reaction_key": "ANGRY",
                            "count": 10,
                            "ahead_users": [
                                "ou_8f1991a29a47f1ad295a119dadf224d1"
                            ]
                        }
                    ]
                }
            ]
        }
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 1069301 | fail | Please try again. If the problem persists, contact the oncall personnel of the related service party.
400 | 1069302 | param error | Check whether the parameter is valid.
403 | 1069303 | forbidden | Check whether you have the permission to comment on the document.
400 | 1069304 | docs had been deleted | Check whether the document to comment on has been deleted.
400 | 1069305 | docs not exist | Check whether you have access to the document to comment on.
400 | 1069306 | content review not pass | Check whether the comment contains invalid content.
404 | 1069307 | not exist | Check whether you have access to the document to comment on and whether the person that is @mentioned by the comment or the document in Docs to comment on exists.
400 | 1069308 | exceeded limit | The comment data has reached the limit. For more information, contact the Customer Service.
400 | 1069399 | internal error | Please try again. If the problem persists, contact the oncall personnel of the related service party.

