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/gmailpostmastertools.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 gmailpostmastertools = google.gmailpostmastertools('v1');
    
    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/postmaster.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 gmailpostmastertools.domains.get({
        // The resource name of the domain. It should have the form `domains/{domain_name\}`, where domain_name is the fully qualified domain name.
        name: 'domains/my-domain',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "createTime": "my_createTime",
      //   "name": "my_name",
      //   "permission": "my_permission"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/gmailpostmastertools.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 gmailpostmastertools = google.gmailpostmastertools('v1beta1');
    
    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/postmaster.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 gmailpostmastertools.domains.get({
        // The resource name of the domain. It should have the form `domains/{domain_name\}`, where domain_name is the fully qualified domain name.
        name: 'domains/my-domain',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "createTime": "my_createTime",
      //   "name": "my_name",
      //   "permission": "my_permission"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/gmailpostmastertools.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 gmailpostmastertools = google.gmailpostmastertools('v1');
    
    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/postmaster.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 gmailpostmastertools.domains.list({
        // Requested page size. Server may return fewer domains than requested. If unspecified, server will pick an appropriate default.
        pageSize: 'placeholder-value',
        // The next_page_token value returned from a previous List request, if any. This is the value of ListDomainsResponse.next_page_token returned from the previous call to `ListDomains` method.
        pageToken: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "domains": [],
      //   "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/gmailpostmastertools.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 gmailpostmastertools = google.gmailpostmastertools('v1beta1');
    
    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/postmaster.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 gmailpostmastertools.domains.trafficStats.get({
        // The resource name of the traffic statistics to get. E.g., domains/mymail.mydomain.com/trafficStats/20160807.
        name: 'domains/my-domain/trafficStats/my-trafficStat',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "deliveryErrors": [],
      //   "dkimSuccessRatio": {},
      //   "dmarcSuccessRatio": {},
      //   "domainReputation": "my_domainReputation",
      //   "inboundEncryptionRatio": {},
      //   "ipReputations": [],
      //   "name": "my_name",
      //   "outboundEncryptionRatio": {},
      //   "spammyFeedbackLoops": [],
      //   "spfSuccessRatio": {},
      //   "userReportedSpamRatio": {}
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • const {google} = require('googleapis');
    const gmailpostmastertools = google.gmailpostmastertools('v1beta1');
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples