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.channels.stop({
        // 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);
    }
    
    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.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.apps.get({
        // The ID of the app.
        appId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "authorized": false,
      //   "createInFolderTemplate": "my_createInFolderTemplate",
      //   "createUrl": "my_createUrl",
      //   "hasDriveWideScope": false,
      //   "icons": [],
      //   "id": "my_id",
      //   "installed": false,
      //   "kind": "my_kind",
      //   "longDescription": "my_longDescription",
      //   "name": "my_name",
      //   "objectType": "my_objectType",
      //   "openUrlTemplate": "my_openUrlTemplate",
      //   "primaryFileExtensions": [],
      //   "primaryMimeTypes": [],
      //   "productId": "my_productId",
      //   "productUrl": "my_productUrl",
      //   "secondaryFileExtensions": [],
      //   "secondaryMimeTypes": [],
      //   "shortDescription": "my_shortDescription",
      //   "supportsCreate": false,
      //   "supportsImport": false,
      //   "supportsMultiOpen": false,
      //   "supportsOfflineCreate": false,
      //   "useByDefault": false
      // }
    }
    
    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.get({
        // The ID of the change.
        changeId: 'placeholder-value',
        // The shared drive from which the change 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
      // {
      //   "changeType": "my_changeType",
      //   "deleted": false,
      //   "drive": {},
      //   "driveId": "my_driveId",
      //   "file": {},
      //   "fileId": "my_fileId",
      //   "id": "my_id",
      //   "kind": "my_kind",
      //   "modificationDate": "my_modificationDate",
      //   "selfLink": "my_selfLink",
      //   "teamDrive": {},
      //   "teamDriveId": "my_teamDriveId",
      //   "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
  • // 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.appdata',
          '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.about.get({});
      console.log(res.data);
    
      // Example response
      // {
      //   "appInstalled": false,
      //   "canCreateDrives": false,
      //   "canCreateTeamDrives": false,
      //   "driveThemes": [],
      //   "exportFormats": {},
      //   "folderColorPalette": [],
      //   "importFormats": {},
      //   "kind": "my_kind",
      //   "maxImportSizes": {},
      //   "maxUploadSize": "my_maxUploadSize",
      //   "storageQuota": {},
      //   "teamDriveThemes": [],
      //   "user": {}
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples