comments
Creates, updates, deletes, gets or lists a comments resource.
Overview
| Name | comments |
| Type | Resource |
| Id | googleworkspace.drivev3.comments |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Output only. The ID of the comment. |
anchor | string | A region of the document represented as a JSON string. For details on defining anchor properties, refer to Manage comments and replies. |
assigneeEmailAddress | string | Output only. The email address of the user assigned to this comment. If no user is assigned, the field is unset. |
author | object | Information about a Drive user. (id: User) |
content | string | The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed. |
createdTime | string (date-time) | The time at which the comment was created (RFC 3339 date-time). |
deleted | boolean | Output only. Whether the comment has been deleted. A deleted comment has no content. |
htmlContent | string | Output only. The content of the comment with HTML formatting. |
kind | string | Output only. Identifies what kind of resource this is. Value: the fixed string "drive#comment". (default: drive#comment) |
mentionedEmailAddresses | array | Output only. A list of email addresses for users mentioned in this comment. If no users are mentioned, the list is empty. |
modifiedTime | string (date-time) | The last time the comment or any of its replies was modified (RFC 3339 date-time). |
quotedFileContent | object | The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location of the comment. |
replies | array | Output only. The full list of replies to the comment in chronological order. |
resolved | boolean | Output only. Whether the comment has been resolved by one of its replies. |
| Name | Datatype | Description |
|---|---|---|
id | string | Output only. The ID of the comment. |
anchor | string | A region of the document represented as a JSON string. For details on defining anchor properties, refer to Manage comments and replies. |
assigneeEmailAddress | string | Output only. The email address of the user assigned to this comment. If no user is assigned, the field is unset. |
author | object | Information about a Drive user. (id: User) |
content | string | The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed. |
createdTime | string (date-time) | The time at which the comment was created (RFC 3339 date-time). |
deleted | boolean | Output only. Whether the comment has been deleted. A deleted comment has no content. |
htmlContent | string | Output only. The content of the comment with HTML formatting. |
kind | string | Output only. Identifies what kind of resource this is. Value: the fixed string "drive#comment". (default: drive#comment) |
mentionedEmailAddresses | array | Output only. A list of email addresses for users mentioned in this comment. If no users are mentioned, the list is empty. |
modifiedTime | string (date-time) | The last time the comment or any of its replies was modified (RFC 3339 date-time). |
quotedFileContent | object | The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location of the comment. |
replies | array | Output only. The full list of replies to the comment in chronological order. |
resolved | boolean | Output only. Whether the comment has been resolved by one of its replies. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | fileId, commentId | includeDeleted | Gets a comment by ID. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields. |
list | select | fileId | pageSize, includeDeleted, pageToken, startModifiedTime | Lists a file's comments. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields. |
create | insert | fileId | Creates a comment on a file. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields. | |
update | update | fileId, commentId | Updates a comment with patch semantics. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields. | |
delete | delete | fileId, commentId | Deletes a comment. For more information, see Manage comments and replies. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
commentId | string | |
fileId | string | |
includeDeleted | boolean | |
pageSize | integer (int32) | |
pageToken | string | |
startModifiedTime | string |
SELECT examples
- get
- list
Gets a comment by ID. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields.
SELECT
id,
anchor,
assigneeEmailAddress,
author,
content,
createdTime,
deleted,
htmlContent,
kind,
mentionedEmailAddresses,
modifiedTime,
quotedFileContent,
replies,
resolved
FROM googleworkspace.drivev3.comments
WHERE fileId = '{{ fileId }}' -- required
AND commentId = '{{ commentId }}' -- required
AND includeDeleted = '{{ includeDeleted }}'
;
Lists a file's comments. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields.
SELECT
id,
anchor,
assigneeEmailAddress,
author,
content,
createdTime,
deleted,
htmlContent,
kind,
mentionedEmailAddresses,
modifiedTime,
quotedFileContent,
replies,
resolved
FROM googleworkspace.drivev3.comments
WHERE fileId = '{{ fileId }}' -- required
AND pageSize = '{{ pageSize }}'
AND includeDeleted = '{{ includeDeleted }}'
AND pageToken = '{{ pageToken }}'
AND startModifiedTime = '{{ startModifiedTime }}'
;
INSERT examples
- create
- Manifest
Creates a comment on a file. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields.
INSERT INTO googleworkspace.drivev3.comments (
data__quotedFileContent,
data__createdTime,
data__replies,
data__deleted,
data__kind,
data__htmlContent,
data__anchor,
data__modifiedTime,
data__resolved,
data__content,
data__id,
data__author,
fileId
)
SELECT
'{{ quotedFileContent }}',
'{{ createdTime }}',
'{{ replies }}',
{{ deleted }},
'{{ kind }}',
'{{ htmlContent }}',
'{{ anchor }}',
'{{ modifiedTime }}',
{{ resolved }},
'{{ content }}',
'{{ id }}',
'{{ author }}',
'{{ fileId }}'
RETURNING
id,
anchor,
assigneeEmailAddress,
author,
content,
createdTime,
deleted,
htmlContent,
kind,
mentionedEmailAddresses,
modifiedTime,
quotedFileContent,
replies,
resolved
;
# Description fields are for documentation purposes
- name: comments
props:
- name: fileId
value: "{{ fileId }}"
description: Required parameter for the comments resource.
- name: quotedFileContent
description: |
The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location of the comment.
value:
mimeType: "{{ mimeType }}"
value: "{{ value }}"
- name: createdTime
value: "{{ createdTime }}"
description: |
The time at which the comment was created (RFC 3339 date-time).
- name: replies
description: |
Output only. The full list of replies to the comment in chronological order.
value:
- modifiedTime: "{{ modifiedTime }}"
htmlContent: "{{ htmlContent }}"
createdTime: "{{ createdTime }}"
assigneeEmailAddress: "{{ assigneeEmailAddress }}"
content: "{{ content }}"
author:
emailAddress: "{{ emailAddress }}"
permissionId: "{{ permissionId }}"
photoLink: "{{ photoLink }}"
displayName: "{{ displayName }}"
kind: "{{ kind }}"
me: {{ me }}
action: "{{ action }}"
id: "{{ id }}"
kind: "{{ kind }}"
deleted: {{ deleted }}
mentionedEmailAddresses: "{{ mentionedEmailAddresses }}"
- name: deleted
value: {{ deleted }}
description: |
Output only. Whether the comment has been deleted. A deleted comment has no content.
- name: kind
value: "{{ kind }}"
description: |
Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#comment"`.
default: drive#comment
- name: htmlContent
value: "{{ htmlContent }}"
description: |
Output only. The content of the comment with HTML formatting.
- name: anchor
value: "{{ anchor }}"
description: |
A region of the document represented as a JSON string. For details on defining anchor properties, refer to [Manage comments and replies](https://developers.google.com/workspace/drive/api/v3/manage-comments).
- name: modifiedTime
value: "{{ modifiedTime }}"
description: |
The last time the comment or any of its replies was modified (RFC 3339 date-time).
- name: resolved
value: {{ resolved }}
description: |
Output only. Whether the comment has been resolved by one of its replies.
- name: content
value: "{{ content }}"
description: |
The plain text content of the comment. This field is used for setting the content, while `htmlContent` should be displayed.
- name: id
value: "{{ id }}"
description: |
Output only. The ID of the comment.
- name: author
description: |
Information about a Drive user.
value:
emailAddress: "{{ emailAddress }}"
permissionId: "{{ permissionId }}"
photoLink: "{{ photoLink }}"
displayName: "{{ displayName }}"
kind: "{{ kind }}"
me: {{ me }}
UPDATE examples
- update
Updates a comment with patch semantics. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields.
UPDATE googleworkspace.drivev3.comments
SET
data__quotedFileContent = '{{ quotedFileContent }}',
data__createdTime = '{{ createdTime }}',
data__replies = '{{ replies }}',
data__deleted = {{ deleted }},
data__kind = '{{ kind }}',
data__htmlContent = '{{ htmlContent }}',
data__anchor = '{{ anchor }}',
data__modifiedTime = '{{ modifiedTime }}',
data__resolved = {{ resolved }},
data__content = '{{ content }}',
data__id = '{{ id }}',
data__author = '{{ author }}'
WHERE
fileId = '{{ fileId }}' --required
AND commentId = '{{ commentId }}' --required
RETURNING
id,
anchor,
assigneeEmailAddress,
author,
content,
createdTime,
deleted,
htmlContent,
kind,
mentionedEmailAddresses,
modifiedTime,
quotedFileContent,
replies,
resolved;
DELETE examples
- delete
Deletes a comment. For more information, see Manage comments and replies.
DELETE FROM googleworkspace.drivev3.comments
WHERE fileId = '{{ fileId }}' --required
AND commentId = '{{ commentId }}' --required
;