# Update Reply

Updates a reply to a document in Docs.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id
HTTP Method | PUT
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>Modify comment in document(docs:document.comment:update)<br>Reply, edit, delete comment in document(docs:document.comment:write_only)<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)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### Path parameters

Parameter | Type | Description
---|---|---
file_token | string | Token of the document<br>**Example value**: "doccnHh7U87HOFpii5u5G*****"
comment_id | string | Comment ID<br>**Example value**: "6916106822734578184"
reply_id | string | Reply ID<br>**Example value**: "6916106822734594568"

### 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>- docx：Upgraded Docs<br>- sheet：Sheet<br>- file：File<br>- slides：Slides
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)

### Request body

Parameter | Type | Required | Description
---|---|---|---
content | reply_content | Yes | Reply content
elements | reply_element\[\] | Yes | Reply content
type | string | Yes | Content elements of the reply<br>**Example value**: "text_run"<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 | No | Text content
text | string | Yes | Reply with plain text<br>**Example value**: "comment text"
docs_link | docs_link | No | Text content
url | string | Yes | @mentioned document in a reply.<br>**Example value**: "https://example.feishu.cn/docs/doccnHh7U87HOFpii5u5Gabcef"
person | person | No | Text content
user_id | string | Yes | @mentioned contact in a reply<br>**Example value**: "ou_cc19b2bfb93f8a44db4b4d6eababcef"

### Request body example
```json
{
    "content": {
        "elements": [
            {
                "type": "text_run",
                "text_run": {
                    "text": "comment text"
                },
                "docs_link": {
                    "url": "https://example.feishu.cn/docs/doccnHh7U87HOFpii5u5Gabcef"
                },
                "person": {
                    "user_id": "ou_cc19b2bfb93f8a44db4b4d6eababcef"
                }
            }
        ]
    }
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {}
}
```

### 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.

