目录

Creates a comment.

Request

HTTP Request

POST
https://drive.cloud.hicloud.com/drive/v1/files/{fileId}/comments

Parameters

*Some parameters are mandatory.

parametertype
description
fileIdstringpathFile ID. (Mandatory)
fieldsstringqueryFields in the request, which are in the partial response format.
formstringqueryMedia format.
prettyPrintbooleanqueryIndicates whether to return a response in a human-readable format.
quotaIdstringqueryUser identifier, consisting of 40 characters at maximum. It is used to restrict the number of API calls of an individual user.
callbackstringqueryCallback function used in JSONP requests.
x-hw-trace-idstringheaderID used for service tracing. 
x-hw-app-idstringheaderApp ID. 
versionstringheaderSDK version number.
x-hw-terminalstringheaderDevice model. 
x-hw-osstringheaderDevice operating system.
unionIDstringheaderOpen user ID.
User-AgentstringheaderApp version number or ID. 

Request Body

In the request body, provide data with the following structure:

idstring一个唯一ID,标识这个订阅通道。
descriptionstringContent of the comment.(Mandatory)
quotedContent.mimiTypestringType of the quoted content.
quotedContent.contentstringQuoted content.
positionstringPosition of the comment content, in JSON format. The JSON string is verified based on the Anchor definition.

Response

If successful, this method returns a response body with the following structure:

  1. {
  2.            "category": "drive#comment",
  3.            "id": "string",
  4.            "createdTime": "2020-02-19T14:44:40.660Z",
  5.            "editedTime": "2020-02-19T14:44:40.661Z",
  6.            "creator": {
  7.                "category": "drive#user",
  8.                "displayName": "string",
  9.                "profilePhotoLink": "string",
  10.                "me": true,
  11.                "permissionId": "string",
  12.                "userAccount": "string"
  13.            },
  14.            "description": "string",
  15.            "htmlDescription": "string",
  16.            "deleted": true,
  17.            "resolved": true,
  18.            "quotedContent": {
  19.                "mimeType": "string",
  20.                "content": "string"
  21.            },
  22.            "position": "string",
  23.            "replies": [
  24.            {
  25.                "category": "drive#reply",
  26.                "id": "string",
  27.                "createdTime": "2020-02-19T14:44:40.661Z",
  28.                "editedTime": "2020-02-19T14:44:40.661Z",
  29.                "creator": {
  30.                    "category": "drive#user",
  31.                    "displayName": "string",
  32.                    "profilePhotoLink": "string",
  33.                    "me": true,
  34.                    "permissionId": "string",
  35.                    "userAccount": "string"
  36.                },
  37.                "htmlDescription": "string",
  38.                "description": "string",
  39.                "deleted": true,
  40.                "operate": "string"
  41.            }
  42.            ]
  43. }
categorystring资源类型,固定为api#channel。
categorystringResource type. The value is always drive#comment.
idstringComment ID.
createdTimestringTime when the comment was created.
editedTimestringLast time when the comment was modified.
creator.categorystringCreator type. The value is alwaysdrive#user.
creator.displayName
stringDisplayed name for this user.
creator.profilepPhotoLinkstringLink to the user's profile picture, which is not returned by default.
creator.mebooleanIndicates whether this user is the requesting user.
creator.permissionIdstringPermission ID.
creator.userAccountstringAccount of the user, which is not returned by default.
descriptionstringContent of the comment in plain text format.
htmlDescriptionstringContent of the comment in HTML format.
deletedbooleanIndicates whether the comment has been deleted.
resolvedbooleanIndicates whether the comment has been resolved.
quotedContent.mimeTypestringType of the quoted content.
quotedContent.contentstringQuoted content.
positionstringPosition of the comment content.
replies[]listList of replies to the comment.
replies.categorystringReply type. The value is always drive#reply.
replies.id
stringReply ID.
replies.createdTimestringTime when the reply was created.
replies.editedTimestringLast time when the reply was modified.
replies.creator.categorystringReply creator type. The value is always drive#user.
replies.creator.displayNamestringDisplayed name for this user.
replies.creator.profilePhotoLinkstringLink to the user's profile picture, which is not returned by default.
replies.creator.mebooleanIndicates whether this user is the requesting user.
replies.creator.permissionIdstringPermission ID.
replies.creator.userAccountstringAccount of the user, which is not returned by default.
replies.htmlDescriptionstringReply content in HTML format.
replies.description
stringReply content.
replies.deletedbooleanIndicates whether the reply has been deleted.
replies.operatestringOperation to be performed for the comment.