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.products.delete({
        // The Content API Supplemental Feed ID. If present then product deletion applies to the data in a supplemental feed. If absent, entire product will be deleted.
        feedId: 'placeholder-value',
        // The ID of the account that contains the product. This account cannot be a multi-client account.
        merchantId: 'placeholder-value',
        // The REST ID of the product.
        productId: 'placeholder-value',
      });
      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/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.products.custombatch({
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "entries": []
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "entries": [],
      //   "kind": "my_kind"
      // }
    }
    
    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');
    
    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.products.get({
        // The ID of the account that contains the product. This account cannot be a multi-client account.
        merchantId: 'placeholder-value',
        // The REST ID of the product.
        productId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "additionalImageLinks": [],
      //   "additionalProductTypes": [],
      //   "adult": false,
      //   "adwordsGrouping": "my_adwordsGrouping",
      //   "adwordsLabels": [],
      //   "adwordsRedirect": "my_adwordsRedirect",
      //   "ageGroup": "my_ageGroup",
      //   "aspects": [],
      //   "availability": "my_availability",
      //   "availabilityDate": "my_availabilityDate",
      //   "brand": "my_brand",
      //   "canonicalLink": "my_canonicalLink",
      //   "channel": "my_channel",
      //   "color": "my_color",
      //   "condition": "my_condition",
      //   "contentLanguage": "my_contentLanguage",
      //   "costOfGoodsSold": {},
      //   "customAttributes": [],
      //   "customGroups": [],
      //   "customLabel0": "my_customLabel0",
      //   "customLabel1": "my_customLabel1",
      //   "customLabel2": "my_customLabel2",
      //   "customLabel3": "my_customLabel3",
      //   "customLabel4": "my_customLabel4",
      //   "description": "my_description",
      //   "destinations": [],
      //   "displayAdsId": "my_displayAdsId",
      //   "displayAdsLink": "my_displayAdsLink",
      //   "displayAdsSimilarIds": [],
      //   "displayAdsTitle": "my_displayAdsTitle",
      //   "displayAdsValue": {},
      //   "energyEfficiencyClass": "my_energyEfficiencyClass",
      //   "expirationDate": "my_expirationDate",
      //   "gender": "my_gender",
      //   "googleProductCategory": "my_googleProductCategory",
      //   "gtin": "my_gtin",
      //   "id": "my_id",
      //   "identifierExists": false,
      //   "imageLink": "my_imageLink",
      //   "installment": {},
      //   "isBundle": false,
      //   "itemGroupId": "my_itemGroupId",
      //   "kind": "my_kind",
      //   "link": "my_link",
      //   "loyaltyPoints": {},
      //   "material": "my_material",
      //   "maxEnergyEfficiencyClass": "my_maxEnergyEfficiencyClass",
      //   "maxHandlingTime": "my_maxHandlingTime",
      //   "minEnergyEfficiencyClass": "my_minEnergyEfficiencyClass",
      //   "minHandlingTime": "my_minHandlingTime",
      //   "mobileLink": "my_mobileLink",
      //   "mpn": "my_mpn",
      //   "multipack": "my_multipack",
      //   "offerId": "my_offerId",
      //   "onlineOnly": false,
      //   "pattern": "my_pattern",
      //   "price": {},
      //   "productType": "my_productType",
      //   "promotionIds": [],
      //   "salePrice": {},
      //   "salePriceEffectiveDate": "my_salePriceEffectiveDate",
      //   "sellOnGoogleQuantity": "my_sellOnGoogleQuantity",
      //   "shipping": [],
      //   "shippingHeight": {},
      //   "shippingLabel": "my_shippingLabel",
      //   "shippingLength": {},
      //   "shippingWeight": {},
      //   "shippingWidth": {},
      //   "sizeSystem": "my_sizeSystem",
      //   "sizeType": "my_sizeType",
      //   "sizes": [],
      //   "source": "my_source",
      //   "targetCountry": "my_targetCountry",
      //   "taxes": [],
      //   "title": "my_title",
      //   "unitPricingBaseMeasure": {},
      //   "unitPricingMeasure": {},
      //   "validatedDestinations": [],
      //   "warnings": []
      // }
    }
    
    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');
    
    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.products.list({
        // Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false).
        includeInvalidInsertedItems: 'placeholder-value',
        // The maximum number of products to return in the response, used for paging.
        maxResults: 'placeholder-value',
        // The ID of the account that contains the products. This account cannot be a multi-client account.
        merchantId: 'placeholder-value',
        // The token returned by the previous request.
        pageToken: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "kind": "my_kind",
      //   "nextPageToken": "my_nextPageToken",
      //   "resources": []
      // }
    }
    
    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');
    
    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.get({
        // If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination.
        destinations: 'placeholder-value',
        // Flag to include full product data in the result of this get request. The default value is false.
        includeAttributes: 'placeholder-value',
        // The ID of the account that contains the product. This account cannot be a multi-client account.
        merchantId: 'placeholder-value',
        // The REST ID of the product.
        productId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "creationDate": "my_creationDate",
      //   "dataQualityIssues": [],
      //   "destinationStatuses": [],
      //   "googleExpirationDate": "my_googleExpirationDate",
      //   "itemLevelIssues": [],
      //   "kind": "my_kind",
      //   "lastUpdateDate": "my_lastUpdateDate",
      //   "link": "my_link",
      //   "product": {},
      //   "productId": "my_productId",
      //   "title": "my_title"
      // }
    }
    
    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