Google Drive - Get Changes
@sergio
code:
data:privatelast updated:3 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_startPageToken
Gets the starting pageToken for listing future changes.
auth
(auths.google_drive)
params
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
//See the API docs here: https://developers.google.com/drive/api/v3/reference/changes/getStartPageToken?authuser=2
//This method is used to get the initial page token used when accessing the GET /changes endpoint.
const config = {
  url: `https://www.googleapis.com/drive/v3/changes/startPageToken`,
  params: {
    driveId: params.driveId,
    includeCorpusRemovals: params.includeCorpusRemovals,
    includeItemsFromAllDrives: params.includeItemsFromAllDrives,
    includeRemoved: params.includeRemoved,
    includeTeamDriveItems: params.includeTeamDriveItems,
    pageSize: params.pageSize,    
    restrictToMyDrive: params.restrictToMyDrive,
    spaces: params.spaces,
    supportsAllDrives: params.supportsAllDrives,
    supportsTeamDrives: params.supportsTeamDrives,
    teamDriveId: params.teamDriveId,
    alt: params.alt,
    fields: params.fields || "*", //For improved performance, select actual fields from the related entity required for your use case. "*" selects all 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}`,
  },
}
this.workflowStartPageToken =  (await require("@pipedreamhq/platform").axios(this, config)).startPageToken
steps.
googledrive_get_changes
Gets the changes for a user or shared drive.
auth
(auths.google_drive)
params
Start page_token

The starting pageToken for listing initial changes. Use the getStartPageToken API endpoint to get this value. See a sample workflow available.

 
string ·params.start_page_token
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
//See the API docs here: https://developers.google.com/drive/api/v3/reference/changes/list?authuser=2
const config = {
  url: `https://www.googleapis.com/drive/v3/changes`,
  params: {
    driveId: params.driveId,
    includeCorpusRemovals: params.includeCorpusRemovals,
    includeItemsFromAllDrives: params.includeItemsFromAllDrives,
    includeRemoved: params.includeRemoved,
    includeTeamDriveItems: params.includeTeamDriveItems,
    pageSize: params.pageSize,
    pageToken: params.start_page_token,
    restrictToMyDrive: params.restrictToMyDrive,
    spaces: params.spaces,
    supportsAllDrives: params.supportsAllDrives,
    supportsTeamDrives: params.supportsTeamDrives,
    teamDriveId: params.teamDriveId,
    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}`,
  },
}
return await require("@pipedreamhq/platform").axios(this, config)