How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • // 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.appdata',
          'https://www.googleapis.com/auth/drive.apps.readonly',
          'https://www.googleapis.com/auth/drive.file',
          'https://www.googleapis.com/auth/drive.metadata',
          'https://www.googleapis.com/auth/drive.metadata.readonly',
          'https://www.googleapis.com/auth/drive.photos.readonly',
          '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.changes.watch({
        // The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier.
        driveId: 'placeholder-value',
        // Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file.
        includeCorpusRemovals: 'placeholder-value',
        // Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.
        includeDeleted: 'placeholder-value',
        // Whether both My Drive and shared drive items should be included in results.
        includeItemsFromAllDrives: 'placeholder-value',
        // Specifies which additional view's permissions to include in the response. Only 'published' is supported.
        includePermissionsForView: 'placeholder-value',
        // Whether to include changes outside the My Drive hierarchy in the result. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive are omitted from the result.
        includeSubscribed: 'placeholder-value',
        // Deprecated use includeItemsFromAllDrives instead.
        includeTeamDriveItems: 'placeholder-value',
        // Maximum number of changes to return.
        maxResults: 'placeholder-value',
        // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method.
        pageToken: 'placeholder-value',
        // A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.
        spaces: 'placeholder-value',
        // Deprecated - use pageToken instead.
        startChangeId: 'placeholder-value',
        // Whether the requesting application supports both My Drives and shared drives.
        supportsAllDrives: 'placeholder-value',
        // Deprecated use supportsAllDrives instead.
        supportsTeamDrives: 'placeholder-value',
        // Deprecated use driveId instead.
        teamDriveId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "address": "my_address",
          //   "expiration": "my_expiration",
          //   "id": "my_id",
          //   "kind": "my_kind",
          //   "params": {},
          //   "payload": false,
          //   "resourceId": "my_resourceId",
          //   "resourceUri": "my_resourceUri",
          //   "token": "my_token",
          //   "type": "my_type"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "address": "my_address",
      //   "expiration": "my_expiration",
      //   "id": "my_id",
      //   "kind": "my_kind",
      //   "params": {},
      //   "payload": false,
      //   "resourceId": "my_resourceId",
      //   "resourceUri": "my_resourceUri",
      //   "token": "my_token",
      //   "type": "my_type"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // 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.appdata',
          'https://www.googleapis.com/auth/drive.apps.readonly',
          'https://www.googleapis.com/auth/drive.file',
          'https://www.googleapis.com/auth/drive.metadata',
          'https://www.googleapis.com/auth/drive.metadata.readonly',
          'https://www.googleapis.com/auth/drive.photos.readonly',
          '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.changes.getStartPageToken({
        // The ID of the shared drive for which the starting pageToken for listing future changes from that shared drive is returned.
        driveId: 'placeholder-value',
        // Whether the requesting application supports both My Drives and shared drives.
        supportsAllDrives: 'placeholder-value',
        // Deprecated use supportsAllDrives instead.
        supportsTeamDrives: 'placeholder-value',
        // Deprecated use driveId instead.
        teamDriveId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "kind": "my_kind",
      //   "startPageToken": "my_startPageToken"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • const {google} = require('googleapis');
    const oauth2Client = new google.auth.OAuth2(
      YOUR_CLIENT_ID,
      YOUR_CLIENT_SECRET,
      YOUR_REDIRECT_URL
    );
    
    const drive = google.drive({
      version: 'v2',
      auth: oauth2Client
    });
    Docs
  • const {google} = require('googleapis');
    const drive = google.drive('v2');
    Docs
  • const {google} = require('googleapis');
    const drive = google.drive('v3');
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples