// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/drive.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const drive = google.drive('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/drive.readonly',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await drive.comments.list({
// The ID of the file.
fileId: 'placeholder-value',
// If set, all comments and replies, including deleted comments and replies (with content stripped) will be returned.
includeDeleted: 'placeholder-value',
// The maximum number of discussions to include in the response, used for paging.
maxResults: 'placeholder-value',
// The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.
pageToken: 'placeholder-value',
// Only discussions that were updated after this timestamp will be returned. Formatted as an RFC 3339 timestamp.
updatedMin: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "items": [],
// "kind": "my_kind",
// "nextLink": "my_nextLink",
// "nextPageToken": "my_nextPageToken",
// "selfLink": "my_selfLink"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/drive.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const drive = google.drive('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/drive.file',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await drive.comments.update({
// The ID of the comment.
commentId: 'placeholder-value',
// The ID of the file.
fileId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "anchor": "my_anchor",
// "author": {},
// "commentId": "my_commentId",
// "content": "my_content",
// "context": {},
// "createdDate": "my_createdDate",
// "deleted": false,
// "fileId": "my_fileId",
// "fileTitle": "my_fileTitle",
// "htmlContent": "my_htmlContent",
// "kind": "my_kind",
// "modifiedDate": "my_modifiedDate",
// "replies": [],
// "selfLink": "my_selfLink",
// "status": "my_status"
// }
},
});
console.log(res.data);
// Example response
// {
// "anchor": "my_anchor",
// "author": {},
// "commentId": "my_commentId",
// "content": "my_content",
// "context": {},
// "createdDate": "my_createdDate",
// "deleted": false,
// "fileId": "my_fileId",
// "fileTitle": "my_fileTitle",
// "htmlContent": "my_htmlContent",
// "kind": "my_kind",
// "modifiedDate": "my_modifiedDate",
// "replies": [],
// "selfLink": "my_selfLink",
// "status": "my_status"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/drive.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const drive = google.drive('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/drive.readonly',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await drive.comments.get({
// The ID of the comment.
commentId: 'placeholder-value',
// The ID of the file.
fileId: 'placeholder-value',
// If set, this will succeed when retrieving a deleted comment, and will include any deleted replies.
includeDeleted: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "anchor": "my_anchor",
// "author": {},
// "commentId": "my_commentId",
// "content": "my_content",
// "context": {},
// "createdDate": "my_createdDate",
// "deleted": false,
// "fileId": "my_fileId",
// "fileTitle": "my_fileTitle",
// "htmlContent": "my_htmlContent",
// "kind": "my_kind",
// "modifiedDate": "my_modifiedDate",
// "replies": [],
// "selfLink": "my_selfLink",
// "status": "my_status"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/drive.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const drive = google.drive('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/drive.file',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await drive.replies.update({
// The ID of the comment.
commentId: 'placeholder-value',
// The ID of the file.
fileId: 'placeholder-value',
// The ID of the reply.
replyId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "author": {},
// "content": "my_content",
// "createdDate": "my_createdDate",
// "deleted": false,
// "htmlContent": "my_htmlContent",
// "kind": "my_kind",
// "modifiedDate": "my_modifiedDate",
// "replyId": "my_replyId",
// "verb": "my_verb"
// }
},
});
console.log(res.data);
// Example response
// {
// "author": {},
// "content": "my_content",
// "createdDate": "my_createdDate",
// "deleted": false,
// "htmlContent": "my_htmlContent",
// "kind": "my_kind",
// "modifiedDate": "my_modifiedDate",
// "replyId": "my_replyId",
// "verb": "my_verb"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/drive.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const drive = google.drive('v3');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/drive.file',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await drive.replies.update({
// The ID of the comment.
commentId: 'placeholder-value',
// The ID of the file.
fileId: 'placeholder-value',
// The ID of the reply.
replyId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "action": "my_action",
// "author": {},
// "content": "my_content",
// "createdTime": "my_createdTime",
// "deleted": false,
// "htmlContent": "my_htmlContent",
// "id": "my_id",
// "kind": "my_kind",
// "modifiedTime": "my_modifiedTime"
// }
},
});
console.log(res.data);
// Example response
// {
// "action": "my_action",
// "author": {},
// "content": "my_content",
// "createdTime": "my_createdTime",
// "deleted": false,
// "htmlContent": "my_htmlContent",
// "id": "my_id",
// "kind": "my_kind",
// "modifiedTime": "my_modifiedTime"
// }
}
main().catch(e => {
console.error(e);
throw e;
});