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/content.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 content = google.content('v2.1');
    
    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/content'],
      });
    
      // 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 content.reports.search({
        // Required. Id of the merchant making the call. Must be a standalone account or an MCA subaccount.
        merchantId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "pageSize": 0,
          //   "pageToken": "my_pageToken",
          //   "query": "my_query"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "nextPageToken": "my_nextPageToken",
      //   "results": []
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1');
    
    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/content'],
      });
    
      // 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 content.productstatuses.repricingreports.list({
        // Gets Repricing reports on and before this date in the merchant's timezone. You can only retrieve data up to 7 days ago (default) or earlier. Format is YYYY-MM-DD.
        endDate: 'placeholder-value',
        // Required. Id of the merchant who owns the Repricing rule.
        merchantId: 'placeholder-value',
        // Maximum number of days of reports to return. There can be more than one rule report returned per day. For example, if 3 rule types got applied to the same product within a 24-hour period, then a page_size of 1 will return 3 rule reports. The page size defaults to 50 and values above 1000 are coerced to 1000. This service may return fewer days of reports than this value, for example, if the time between your start and end date is less than the page size.
        pageSize: 'placeholder-value',
        // Token (if provided) to retrieve the subsequent page. All other parameters must match the original call that provided the page token.
        pageToken: 'placeholder-value',
        // Required. Id of the Repricing product. Also known as the [REST_ID](https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product.FIELDS.id)
        productId: 'placeholder-value',
        // Id of the Repricing rule. If specified, only gets this rule's reports.
        ruleId: 'placeholder-value',
        // Gets Repricing reports on and after this date in the merchant's timezone, up to one year ago. Do not use a start date later than 7 days ago (default). Format is YYYY-MM-DD.
        startDate: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "nextPageToken": "my_nextPageToken",
      //   "repricingProductReports": []
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('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/adsense',
          'https://www.googleapis.com/auth/adsense.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 adsense.accounts.reports.generateCsv({
        // Required. The account which owns the collection of reports. Format: accounts/{account\}
        account: 'accounts/my-account',
        // The [ISO-4217 currency code](https://en.wikipedia.org/wiki/ISO_4217) to use when reporting on monetary metrics. Defaults to the account's currency if not set.
        currencyCode: 'placeholder-value',
        // Date range of the report, if unset the range will be considered CUSTOM.
        dateRange: 'placeholder-value',
        // Dimensions to base the report on.
        dimensions: 'placeholder-value',
        // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
        'endDate.day': 'placeholder-value',
        // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
        'endDate.month': 'placeholder-value',
        // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
        'endDate.year': 'placeholder-value',
        // Filters to be run on the report.
        filters: 'placeholder-value',
        // The language to use for translating report output. If unspecified, this defaults to English ("en"). If the given language is not supported, report output will be returned in English. The language is specified as an [IETF BCP-47 language code](https://en.wikipedia.org/wiki/IETF_language_tag).
        languageCode: 'placeholder-value',
        // The maximum number of rows of report data to return. Reports producing more rows than the requested limit will be truncated. If unset, this defaults to 100,000 rows for `Reports.GenerateReport` and 1,000,000 rows for `Reports.GenerateCsvReport`, which are also the maximum values permitted here. Report truncation can be identified (for `Reports.GenerateReport` only) by comparing the number of rows returned to the value returned in `total_matched_rows`.
        limit: 'placeholder-value',
        // Required. Reporting metrics.
        metrics: 'placeholder-value',
        // The name of a dimension or metric to sort the resulting report on, can be prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.
        orderBy: 'placeholder-value',
        // Timezone in which to generate the report. If unspecified, this defaults to the account timezone. For more information, see [changing the time zone of your reports](https://support.google.com/adsense/answer/9830725).
        reportingTimeZone: 'placeholder-value',
        // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
        'startDate.day': 'placeholder-value',
        // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
        'startDate.month': 'placeholder-value',
        // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
        'startDate.year': 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "contentType": "my_contentType",
      //   "data": "my_data",
      //   "extensions": []
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/localservices.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 localservices = google.localservices('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/adwords'],
      });
    
      // 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 localservices.accountReports.search({
        // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
        'endDate.day': 'placeholder-value',
        // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
        'endDate.month': 'placeholder-value',
        // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
        'endDate.year': 'placeholder-value',
        // The maximum number of accounts to return. If the page size is unset, page size will default to 1000. Maximum page_size is 10000. Optional.
        pageSize: 'placeholder-value',
        // The `next_page_token` value returned from a previous request to SearchAccountReports that indicates where listing should continue. Optional.
        pageToken: 'placeholder-value',
        // A query string for searching for account reports. Caller must provide a customer id of their MCC account with an associated Gaia Mint that allows read permission on their linked accounts. Search expressions are case insensitive. Example query: | Query | Description | |-------------------------|-----------------------------------------------| | manager_customer_id:123 | Get Account Report for Manager with id 123. | Required.
        query: 'placeholder-value',
        // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
        'startDate.day': 'placeholder-value',
        // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
        'startDate.month': 'placeholder-value',
        // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
        'startDate.year': 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "accountReports": [],
      //   "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