Google Drive - Create Comment
@sergio
code:
data:privatelast updated:4 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
googledrive_create_comment
Creates a new comment on a file.
auth
(auths.google_drive)
params
Content

The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed.

 
string ·params.content
FileId

The ID of the file.

 
string ·params.fileId
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
}
35
//See the API docs here: https://developers.google.com/drive/api/v3/reference/comments/create?authuser=2
const data = {
  anchor: params.anchor,
  author: params.author,
  content: params.content,
  createdTime: params.createdTime,
  deleted: params.deleted,
  htmlContent: params.htmlContent,
  id: params.id,
  kind: params.kind,
  modifiedTime: params.modifiedTime,
  quotedFileContent: params.quotedFileContent,
  replies: params.replies,
  resolved: params.resolved,
}
const config = {
  method: "post",
  url: `https://www.googleapis.com/drive/v3/files/${params.fileId}/comments`,
  params: {
    alt: params.alt,
    fields: params.fields || "*",
    key: params.key,
    oauth_token: params.oauth_token,
    prettyPrint: params.prettyPrint,
    quotaUser: params.quotaUser,
    userIp: params.userIp,
  },
  headers: {
    Authorization: `Bearer ${auths.google_drive.oauth_access_token}`,
  },
  data,
}
return await require("@pipedreamhq/platform").axios(this, config)