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/factchecktools.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 factchecktools = google.factchecktools('v1alpha1');
    
    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/userinfo.email'],
      });
    
      // 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 factchecktools.pages.delete({
        // The name of the resource to delete, in the form of `pages/{page_id\}`.
        name: 'pages/my-page',
      });
      console.log(res.data);
    
      // Example response
      // {}
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • const {google} = require('googleapis');
    const factchecktools = google.factchecktools('v1alpha1');
    Docs
  • const {GoogleAuth} = require('google-auth-library');
    
    /**
    * Instead of specifying the type of client you'd like to use (JWT, OAuth2, etc)
    * this library will automatically choose the right client based on the environment.
    */
    async function main() {
      const auth = new GoogleAuth({
        scopes: 'https://www.googleapis.com/auth/cloud-platform'
      });
      const client = await auth.getClient();
      const projectId = await auth.getProjectId();
      const url = `https://dns.googleapis.com/dns/v1/projects/${projectId}`;
      const res = await client.request({ url });
      console.log(res.data);
    }
    
    main().catch(console.error);
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.5');
    
    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/dfatrafficking'],
      });
    
      // 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 dfareporting.advertiserLandingPages.list({
        // Select only landing pages that belong to these advertisers.
        advertiserIds: 'placeholder-value',
        // Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages.
        archived: 'placeholder-value',
        // Select only landing pages that are associated with these campaigns.
        campaignIds: 'placeholder-value',
        // Select only landing pages with these IDs.
        ids: 'placeholder-value',
        // Maximum number of results to return.
        maxResults: 'placeholder-value',
        // Value of the nextPageToken from the previous result page.
        pageToken: 'placeholder-value',
        // User profile ID associated with this request.
        profileId: 'placeholder-value',
        // Allows searching for landing pages by name or ID. Wildcards (*) are allowed. For example, "landingpage*2017" will return landing pages with names like "landingpage July 2017", "landingpage March 2017", or simply "landingpage 2017". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "landingpage" will match campaigns with name "my landingpage", "landingpage 2015", or simply "landingpage".
        searchString: 'placeholder-value',
        // Field by which to sort the list.
        sortField: 'placeholder-value',
        // Order of sorted results.
        sortOrder: 'placeholder-value',
        // Select only landing pages that belong to this subaccount.
        subaccountId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "kind": "my_kind",
      //   "landingPages": [],
      //   "nextPageToken": "my_nextPageToken"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4');
    
    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/dfatrafficking'],
      });
    
      // 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 dfareporting.advertiserLandingPages.list({
        // Select only landing pages that belong to these advertisers.
        advertiserIds: 'placeholder-value',
        // Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages.
        archived: 'placeholder-value',
        // Select only landing pages that are associated with these campaigns.
        campaignIds: 'placeholder-value',
        // Select only landing pages with these IDs.
        ids: 'placeholder-value',
        // Maximum number of results to return.
        maxResults: 'placeholder-value',
        // Value of the nextPageToken from the previous result page.
        pageToken: 'placeholder-value',
        // User profile ID associated with this request.
        profileId: 'placeholder-value',
        // Allows searching for landing pages by name or ID. Wildcards (*) are allowed. For example, "landingpage*2017" will return landing pages with names like "landingpage July 2017", "landingpage March 2017", or simply "landingpage 2017". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "landingpage" will match campaigns with name "my landingpage", "landingpage 2015", or simply "landingpage".
        searchString: 'placeholder-value',
        // Field by which to sort the list.
        sortField: 'placeholder-value',
        // Order of sorted results.
        sortOrder: 'placeholder-value',
        // Select only landing pages that belong to this subaccount.
        subaccountId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "kind": "my_kind",
      //   "landingPages": [],
      //   "nextPageToken": "my_nextPageToken"
      // }
    }
    
    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