2024-06-05 10:19:46 +00:00
|
|
|
---
|
|
|
|
sidebar_position: 1
|
|
|
|
---
|
|
|
|
|
|
|
|
# Create comment
|
|
|
|
Creates a comment for a file or directory
|
|
|
|
|
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
`Function CreateComment(Val Token, Val Identifier, Val Comment) Export`
|
2024-06-05 10:19:46 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
| Parameter | CLI option | Type | Description |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Token |
|
|
|
|
| Identifier | --object | String | Identifier of the object that needs a comment |
|
|
|
|
| Comment | --text | String | Comment text |
|
2024-06-05 10:19:46 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Google
|
2024-06-05 10:19:46 +00:00
|
|
|
|
2024-07-10 14:05:58 +03:00
|
|
|
<br/>
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 10:19:46 +00:00
|
|
|
```bsl title="Code example"
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
Identifier = "1rCyOc4A8VYw7DM3HV55P9BuKWayJOSvW";
|
|
|
|
Comment = "NewComment";
|
|
|
|
|
|
|
|
Response = OPI_GoogleDrive.CreateComment(Token, Identifier, Comment); //Map
|
|
|
|
Response = OPI_Tools.JSONString(Response); //String
|
2024-06-05 10:19:46 +00:00
|
|
|
```
|
2024-08-13 15:52:26 +03:00
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-06-05 10:19:46 +00:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
oint gdrive CreateComment --token %token% --object "1rCyOc4A8VYw7DM3HV55P9BuKWayJOSvW" --text %text%
|
2024-06-05 10:19:46 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-08-14 09:06:31 +03:00
|
|
|
{
|
2024-08-13 15:52:26 +03:00
|
|
|
"content": "NewComment",
|
|
|
|
"htmlContent": "NewComment",
|
|
|
|
"author": {
|
|
|
|
"photoLink": "//lh3.googleusercontent.com/a/ACg8ocLx8JGurt0UjXFwwTiB6ZoDPWslW1EnfCTahrwrIllM6Q=s50-c-k-no",
|
|
|
|
"me": true,
|
|
|
|
"kind": "drive#user",
|
|
|
|
"displayName": "Anton Titovets"
|
|
|
|
},
|
|
|
|
"replies": [],
|
|
|
|
"modifiedTime": "2024-03-17T12:53:45.469Z",
|
|
|
|
"createdTime": "2024-03-17T12:53:45.469Z",
|
|
|
|
"kind": "drive#comment",
|
|
|
|
"deleted": false,
|
|
|
|
"id": "AAABI3NNNAY"
|
|
|
|
}
|
2024-06-05 10:19:46 +00:00
|
|
|
```
|