REST Resource: comments
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# REST Resource: comments\n\n- [Resource: Comment](#Comment)\n - [JSON representation](#Comment.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Comment\n-----------------\n\nA comment on a file in Google Drive.\n\nSome resource methods (such as `comments.update`) require a `commentId`. Use the `comments.list` method to retrieve the ID for a comment in a file.\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"replies\": [ { object (/workspace/drive/api/reference/rest/v2/replies#CommentReply) } ], \"commentId\": string, \"kind\": string, \"createdDate\": string, \"modifiedDate\": string, \"fileId\": string, \"status\": string, \"anchor\": string, \"author\": { object (/workspace/drive/api/reference/rest/v2/User) }, \"deleted\": boolean, \"selfLink\": string, \"htmlContent\": string, \"content\": string, \"context\": { \"type\": string, \"value\": string }, \"fileTitle\": string } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `replies[]` | `object (`[CommentReply](/workspace/drive/api/reference/rest/v2/replies#CommentReply)`)` Output only. Replies to this post. |\n| `commentId` | `string` Output only. The ID of the comment. |\n| `kind` | `string` Output only. This is always `drive#comment`. |\n| `createdDate` | `string` Output only. The date when this comment was first created. |\n| `modifiedDate` | `string` Output only. The date when this comment or any of its replies were last modified. |\n| `fileId` | `string` Output only. The file which this comment is addressing. |\n| `status` | `string` Output only. The status of this comment. Status can be changed by posting a reply to a comment with the desired status. - `open` - The comment is still open. - `resolved` - The comment has been resolved by one of its replies. |\n| `anchor` | `string` A region of the document represented as a JSON string. For details on defining anchor properties, refer to [Add comments and replies](https://developers.google.com/workspace/drive/api/v2/manage-comments). |\n| `author` | `object (`[User](/workspace/drive/api/reference/rest/v2/User)`)` Output only. The author of the comment. The author's email address and permission ID will not be populated. |\n| `deleted` | `boolean` Output only. Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed. |\n| `selfLink` | `string` Output only. A link back to this comment. |\n| `htmlContent` | `string` Output only. HTML formatted content for this comment. |\n| `content` | `string` The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content. |\n| `context` | `object` The context of the file which is being commented on. |\n| `context.type` | `string` The MIME type of the context snippet. |\n| `context.value` | `string` Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about. |\n| `fileTitle` | `string` Output only. The title of the file which this comment is addressing. |\n\n| Methods ------- ||\n|----------------------------------------------------------------------|------------------------------------------|\n| ### [delete](/workspace/drive/api/reference/rest/v2/comments/delete) | Deletes a comment. |\n| ### [get](/workspace/drive/api/reference/rest/v2/comments/get) | Gets a comment by ID. |\n| ### [insert](/workspace/drive/api/reference/rest/v2/comments/insert) | Creates a new comment on the given file. |\n| ### [list](/workspace/drive/api/reference/rest/v2/comments/list) | Lists a file's comments. |\n| ### [patch](/workspace/drive/api/reference/rest/v2/comments/patch) | Updates an existing comment. |\n| ### [update](/workspace/drive/api/reference/rest/v2/comments/update) | Updates an existing comment. |"]]