Drive Kit allows your app to provide file commenting functions for users, including commenting on files in the cloud as well as viewing, updating, and deleting comments.
Introduction
Creates a comment on a file using the Comments.create API.
Restrictions
Sending a Request to Create a Comment on a File
Example:
POST https://driveapis.cloud.huawei.com.cn/drive/v1/files/{fileId}/comments?fields=* POST https://driveapis.cloud.huawei.com.cn/drive/v1/files/AAAB9Wn0DTQCIqPbW9avGjAQo9dbxg04A/comments?fields=* HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer CV3PnPLZXyr9K2GV7RYZkF962JZvoEkMQhTho3QHQAPQUyma/lEyZskP/IMWrc7FvaeHivO7y0lyibI/fQvulBnTgtXArSVPsjaLKvYNkDsJSaIR2/sx+K40bYDWWpKFvJNKg2U47jRwz2mfiF3ortNk
Cache-Control: no-cache
{
"description":"2020/02/17 11:20",
"quotedContent":{"mimeType":"text/html","content":"222222"},
"position":"{'revision':'1-0','region':[{'line':{'ln':1,'len':2,'flen':10}}]}"
} Response example:
HTTP/1.1 200 OK
{
"creator": {
"permissionId": "299639512454136576",
"displayName": "*******3121@**3.com",
"me": true,
"category": "drive#user"
},
"editedTime": "2020-02-19T13:13:23.635Z",
"deleted": false,
"description": "2020/02/17 11:20",
"createdTime": "2020-02-19T13:13:23.635Z",
"position": "{'revision':'1-0','region':[{'line':{'ln':1,'len':2,'flen':10}}]}",
"id": "BkytC_85-y5hoiLxCRnNCHZcDynNC_siY",
"htmlDescription": "2020/02/17 11:20",
"category": "drive#comment",
"quotedContent": {
"mimeType": "text/html",
"content": "222222"
}
} Introduction
Obtains a comment using the Comments.get API.
Restrictions
Sending a Request to Obtain a Comment
Example:
GET https://driveapis.cloud.huawei.com.cn/drive/v1/files/{fileId}/comments/{commentId}?fields=* GET https://driveapis.cloud.huawei.com.cn/drive/v1/files/AAAB9Wn0DTQCIqPbW9avGjAQo9dbxg04A/comments/BkytC_85-y5hoiLxCRnNCHZcDynNC_siY?fields=* HTTP/1.1 Accept: application/json Authorization: Bearer CV3PnPLZXyr9K2GV7RYZkF962JZvoEkMQhTho3QHQAPQUyma/lEyZskP/IMWrc7FvaeHivO7y0lyibI/fQvulBnTgtXArSVPsjaLKvYNkDsJSaIR2/sx+K40bYDWWpKFvJNKg2U47jRwz2mfiF3ortNk Cache-Control: no-cache
Response example:
HTTP/1.1 200 OK
{
"creator": {
"permissionId": "299639512454136576",
"displayName": "*******3121@**3.com",
"me": true,
"category": "drive#user"
},
"editedTime": "2020-02-19T13:13:23.635Z",
"deleted": false,
"description": "2020/02/17 11:20",
"createdTime": "2020-02-19T13:13:23.635Z",
"position": "{'revision':'1-0','region':[{'line':{'ln':1,'len':2,'flen':10}}]}",
"id": "BkytC_85-y5hoiLxCRnNCHZcDynNC_siY",
"htmlDescription": "2020/02/17 11:20",
"category": "drive#comment",
"quotedContent": {
"mimeType": "text/html",
"content": "222222"
}
} Introduction
Lists all comments on a file using the Comments.list API, including setting startEditedTime, which indicates the time starting from which the created comments will be listed, and pageSize, which indicates the number of comments to be displayed on each page.
Restrictions
Note
Currently, the includeDeleted parameter is not used.
Sending a Request to List Comments
Example:
GET https://driveapis.cloud.huawei.com.cn/drive/v1/files/{fileId}/comments?fields=* GET https://driveapis.cloud.huawei.com.cn/drive/v1/files/AAAB9Wn0DTQCIqPbW9avGjAQo9dbxg04A/comments?fields=* HTTP/1.1 Accept: application/json Authorization: Bearer CV3PnPLZXyr9K2GV7RYZkF962JZvoEkMQhTho3QHQAPQUyma/lEyZskP/IMWrc7FvaeHivO7y0lyibI/fQvulBnTgtXArSVPsjaLKvYNkDsJSaIR2/sx+K40bYDWWpKFvJNKg2U47jRwz2mfiF3ortNk Cache-Control: no-cache
Response example:
HTTP/1.1 200 OK
{
"nextCursor": "BF5D1350B585F44D5A359F0BF8883A195",
"comments": [
{
"creator": {
"permissionId": "299639512454136576",
"displayName": "*******3121@**3.com",
"me": true,
"category": "drive#user"
},
"editedTime": "2020-02-18T06:09:33Z",
"deleted": false,
"description": "2020/02/1777 11:70",
"createdTime": "2020-02-18T06:09:33Z",
"position": "{'revision':'1-0','region':[{'line':{'ln':1,'len':2,'flen':10}}]}",
"id": "BnGCVaQyhH6CMBTwGXE1BV5hIHeWAIRyg",
"htmlDescription": "2020/02/1777 11:70",
"category": "drive#comment",
"quotedContent": {
"mimeType": "text/html",
"content": "222222"
}
},
{
"creator": {
"permissionId": "299639512454136576",
"displayName": "*******3121@**3.com",
"me": true,
"category": "drive#user"
},
"editedTime": "2020-02-18T06:21:21Z",
"deleted": false,
"description": "2020/02/1777 11:70",
"createdTime": "2020-02-18T06:21:21Z",
"position": "{'revision':'1-0','region':[{'line':{'ln':1,'len':2,'flen':10}}]}",
"id": "Bg98CUePG7_oH4b9qLUhJ04f3it1vRuz6",
"htmlDescription": "2020/02/1777 11:70",
"category": "drive#comment",
"quotedContent": {
"mimeType": "text/html",
"content": "222222"
}
},
{
"creator": {
"permissionId": "299639512454136576",
"displayName": "*******3121@**3.com",
"me": true,
"category": "drive#user"
},
"editedTime": "2020-02-18T07:18:22Z",
"deleted": false,
"description": "2020/02/178 11:70",
"createdTime": "2020-02-18T07:18:22Z",
"position": "{'revision':'1-0','region':[{'line':{'ln':1,'len':2,'flen':10}}]}",
"id": "BkvcvwRTGlCS9V1SPh0FPLZbfp02YRpck",
"htmlDescription": "2020/02/178 11:70",
"category": "drive#comment",
"quotedContent": {
"mimeType": "text/html",
"content": "222222"
}
},
{
"creator": {
"permissionId": "299639512454136576",
"displayName": "*******3121@**3.com",
"me": true,
"category": "drive#user"
},
"editedTime": "2020-02-19T13:13:24Z",
"deleted": false,
"description": "2020/02/17 11:20",
"createdTime": "2020-02-19T13:13:24Z",
"position": "{'revision':'1-0','region':[{'line':{'ln':1,'len':2,'flen':10}}]}",
"id": "BkytC_85-y5hoiLxCRnNCHZcDynNC_siY",
"htmlDescription": "2020/02/17 11:20",
"category": "drive#comment",
"quotedContent": {
"mimeType": "text/html",
"content": "222222"
}
}
],
"category": "drive#commentList"
} Introduction
Deletes a comment using the Comments.delete API.
Restrictions
Sending a Request to Delete a Comment
Example:
DELETE https://driveapis.cloud.huawei.com.cn/drive/v1/files/{fileId}/comments/{commentId} DELETE https://driveapis.cloud.huawei.com.cn/drive/v1/files/AAAB9Wn0DTQCIqPbW9avGjAQo9dbxg04A/comments/BkytC_85-y5hoiLxCRnNCHZcDynNC_siY HTTP/1.1 Authorization: Bearer CV3PnPLZXyr9K2GV7RYZkF962JZvoEkMQhTho3QHQAPQUyma/lEyZskP/IMWrc7FvaeHivO7y0lyibI/fQvulBnTgtXArSVPsjaLKvYNkDsJSaIR2/sx+K40bYDWWpKFvJNKg2U47jRwz2mfiF3ortNk Cache-Control: no-cache
Response example:
HTTP/1.1 204 OK
Introduction
Updates a comment using the Comments.update API.
Restrictions
Sending a Request to Update a Comment
Example:
PATCH https://driveapis.cloud.huawei.com.cn/drive/v1/files/{fileId}/comments/{commentId}?fields=* PATCH https://driveapis.cloud.huawei.com.cn/drive/v1/files/AAAB9Wn0DTQCIqPbW9avGjAQo9dbxg04A/comments/BkytC_85-y5hoiLxCRnNCHZcDynNC_siY?fields=* HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer CV3PnPLZXyr9K2GV7RYZkF962JZvoEkMQhTho3QHQAPQUyma/lEyZskP/IMWrc7FvaeHivO7y0lyibI/fQvulBnTgtXArSVPsjaLKvYNkDsJSaIR2/sx+K40bYDWWpKFvJNKg2U47jRwz2mfiF3ortNk
Cache-Control: no-cache
{
"description":"2020/02/18 11:20"
} Response example:
HTTP/1.1 200 OK
{
"creator": {
"permissionId": "299639512454136576",
"displayName": "*******3121@**3.com",
"me": true,
"category": "drive#user"
},
"editedTime": "2020-02-19T13:13:23.635Z",
"deleted": false,
"description": "2020/02/18 11:20",
"createdTime": "2020-02-19T13:13:23.635Z",
"position": "{'revision':'1-0','region':[{'line':{'ln':1,'len':2,'flen':10}}]}",
"id": "BkytC_85-y5hoiLxCRnNCHZcDynNC_siY",
"htmlDescription": "2020/02/17 11:20",
"category": "drive#comment",
"quotedContent": {
"mimeType": "text/html",
"content": "222222"
}
}