ব্যাচ মোড

আপনি একটি একক API কলে একাধিক পণ্য insert করতে, get বা delete custombatch ব্যবহার করতে পারেন৷

কাস্টম ব্যাচ API-এ একটি কল করতে নিম্নলিখিত অনুরোধ URL ব্যবহার করুন:

POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch

অনুরোধের মূল অংশে নির্দিষ্ট পরামিতি রয়েছে: batchId , merchantID এবং একটি method

আপনি যদি একটি লাভ বা মুছে ফেলছেন তবেই কেবলমাত্র productId ব্যবহার করুন। custombatch জন্য একটি সন্নিবেশ API কলে productId প্রয়োজন হয় না।

custombatch: সন্নিবেশ করান

নিম্নলিখিত অনুরোধ URLটি একটি products.custombatch method=insert করতে ব্যবহৃত হয়

POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch

দুটি নতুন পণ্য সন্নিবেশ করতে, প্রতিটি পণ্যের জন্য batchId , API কল করার জন্য অনুমোদিত বণিকের merchantId এবং পদ্ধতি insert

নিম্নলিখিত উদাহরণে, batchId মানগুলি যথাক্রমে 1111 এবং 1112 , এবং প্রতিটি পণ্যের জন্য অনন্য শনাক্তকারী৷ merchantId: 1234567 হল সেই বণিক যে API কল করার জন্য অনুমোদিত, এবং পদ্ধতি হল get , delete , or insert .

একটি insert একটি নতুন পণ্য তৈরি করে। প্রদত্ত পণ্যের জন্য channel , contentLanguage , offerId , এবং feedLabel এর জন্য মান বিদ্যমান থাকলে, এই পদ্ধতিটি এন্ট্রি আপডেট করে এবং পণ্যের জন্য পূর্ববর্তী API কল থেকে সমস্ত ডেটা প্রতিস্থাপন করে।

একটি একক API কল ব্যবহার করে বণিক কেন্দ্রের ডাটাবেসে দুটি টি-শার্ট insert জন্য এখানে একটি নমুনা JSON বডি রয়েছে:

{
  "entries": [
    {
      "batchId": 1111,
      "merchantId": 1234567,
      "method": "insert",
      "product": {
        "kind": "content#product",
        "offerId": "1111111111",

        "title": "Google Tee Black",
        "description": "The Black Google Tee is available in unisex sizing and
        features a retail fit.",
        "link": "http://my.site.com/blacktee/",
        "imageLink": "https://shop.example.com/.../images/GGOEGXXX1100.jpg",
        "contentLanguage": "en",
        "targetCountry": "US",
        "feedLabel": "US",
        "channel": "online",
        "ageGroup": "adult",
        "availability": "in stock",
        "availabilityDate": "2019-01-25T13:00:00-08:00",
        "brand": "Google",
        "color": "black",
        "condition": "new",
        "gender": "male",
        "googleProductCategory": "1604",
        "gtin": "608802531656",
        "itemGroupId": "google_tee",
        "mpn": "608802531656",
        "price": {
          "value": "21.99",
          "currency": "USD"
        },
        "sizes": [
          "Large"
        ],
        "includedDestination": [
          "Shopping"
        ]
      }
    },
    {
      "batchId": 1112,
      "merchantId": 1234567,
      "method": "insert",
      "product": {
        "kind": "content#product",
        "offerId": "2222222222",

        "title": "Google Tee Green",
        "description": "100% cotton jersey fabric sets  this Google t-shirt above
        the crowd. Features the google logo across the chest. Unisex sizing.",
        "link": "http://my.site.com/greentee/",
        "imageLink": "https://shop.example.com/.../images/GGOEGXXX0906.jpg",
        "contentLanguage": "en",
        "targetCountry": "US",
        "feedLabel": "US",
        "channel": "online",
        "ageGroup": "adult",
        "availability": "in stock",
        "availabilityDate": "2019-01-25T13:00:00-08:00",
        "brand": "Google",
        "color": "green",
        "condition": "new",
        "gender": "male",
        "googleProductCategory": "1604",
        "gtin": "608802531649",
        "itemGroupId": "google_tee",
        "mpn": "608802531649",
        "price": {
          "value": "21.99",
          "currency": "USD"
        },
        "sizes": [
          "Medium"
        ],
        "includedDestination": [
          "Shopping"
        ]
      }
    }
  ]
}

একটি সফল API কল একটি HTTP 200 কোড এবং JSON প্রতিক্রিয়া প্রদান করে যাতে ঢোকানো পণ্যগুলি অন্তর্ভুক্ত থাকে। রিটার্ন JSON এর বিন্যাস নিম্নলিখিত অনুরূপ:

{
 "kind": "content#productsCustomBatchResponse",
 "entries": [
  {
   "kind": "content#productsCustomBatchResponseEntry",
   "batchId": 1111,
   "product": {
    "kind": "content#product",
    "id": "online:en:US:1111111111",
    "offerId": "1111111111",
    "title": "Google Tee Black",
    "description": "The Black Google Tee is available in unisex sizing and
    features a retail fit.",
    "link": "http://my.site.com/blacktee/",
    "imageLink": "https://shop.example.com/.../images/GGOEGXXX1100.jpg",
    "contentLanguage": "en",
    "targetCountry": "US",
    "feedLabel": "US",
    "channel": "online",
    "ageGroup": "adult",
    "availability": "in stock",
    "availabilityDate": "2019-01-25T13:00:00-08:00",
    "brand": "Google",
    "color": "black",
    "condition": "new",
    "gender": "male",
    "googleProductCategory": "1604",
    "gtin": "608802531656",
    "itemGroupId": "google_tee",
    "mpn": "608802531656",
    "price": {
     "value": "21.99",
     "currency": "USD"
    },
    "sizes": [
     "Large"
    ],
    "includedDestination": [
      "Shopping"
    ]
   }
  },
  {
   "kind": "content#productsCustomBatchResponseEntry",
   "batchId": 1112,
   "product": {
    "kind": "content#product",
    "id": "online:en:US:2222222222",
    "offerId": "2222222222",
    "title": "Google Tee Green",
    "description": "100% cotton jersey fabric sets this Google t-shirt above
    the crowd. Features the google logo across the chest. Unisex sizing.",
    "link": "http://my.site.com/greentee/",
    "imageLink": "https://shop.example.com/.../images/GGOEGXXX0906.jpg",
    "contentLanguage": "en",
    "targetCountry": "US",
    "feedLabel": "US",
    "channel": "online",
    "ageGroup": "adult",
    "availability": "in stock",
    "availabilityDate": "2019-01-25T13:00:00-08:00",
    "brand": "Google",
    "color": "green",
    "condition": "new",
    "gender": "male",
    "googleProductCategory": "1604",
    "gtin": "608802531649",
    "itemGroupId": "google_tee",
    "mpn": "608802531649",
    "price": {
     "value": "21.99",
     "currency": "USD"
    },
    "sizes": [
     "Medium"
    ],
    "includedDestination": [
      "Shopping"
    ]
   }
  }
 ]
}

custombatch: পান

নিম্নলিখিত অনুরোধ URL একটি products.custombatch কল করে method=get :

POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch

একটি পণ্য পেতে, API কলের জন্য পণ্যটির জন্য অনন্য batchId , API কল করার জন্য অনুমোদিত বণিকের merchantId , পদ্ধতি get এবং পুনরুদ্ধার করা পণ্যের productId উল্লেখ করুন।

পূর্ববর্তী custombatch:insert তাদের productId মান দ্বারা নির্দিষ্ট করা উদাহরণ সন্নিবেশ করান। batchId তালিকার প্রতিটি আইটেমের জন্য অনন্য:

{
  "entries": [
    {
      "batchId": 1113,
      "merchantId": 1234567,
      "method": "get",
      "productId": "online:en:US:1111111111"
    },
    {
      "batchId": 1114,
      "merchantId": 1234567,
      "method": "get",
      "productId": "online:en:US:2222222222"
    }
  ]
}

এই কলটি একটি HTTP 200 কোড এবং নিম্নলিখিত প্রতিক্রিয়া বডি প্রদান করে:

{
 "kind": "content#productsCustomBatchResponse",
 "entries": [
  {
   "kind": "content#productsCustomBatchResponseEntry",
   "batchId": 1113,
   "product": {
    "kind": "content#product",
    "id": "online:en:US:1111111111",
    "offerId": "1111111111",
    "title": "Google Tee Black",
    "description": "The Black Google Tee is available in unisex sizing and features a retail fit.",
    "link": "http://my.site.com/blacktee/",
    "imageLink": "https://shop.example.com/.../images/GGOEGXXX1100.jpg",
    "contentLanguage": "en",
    "targetCountry": "US",
    "feedLabel": "US",
    "channel": "online",
    "ageGroup": "adult",
    "availability": "in stock",
    "availabilityDate": "2019-01-25T13:00:00-08:00",
    "brand": "Google",
    "color": "black",
    "condition": "new",
    "gender": "male",
    "googleProductCategory": "1604",
    "gtin": "608802531656",
    "itemGroupId": "google_tee",
    "mpn": "608802531656",
    "price": {
     "value": "21.99",
     "currency": "USD"
    },
    "sizes": [
     "Large"
    ],
    "includedDestination": [
      "Shopping"
    ]
   }
  },
  {
   "kind": "content#productsCustomBatchResponseEntry",
   "batchId": 1114,
   "product": {
    "kind": "content#product",
    "id": "online:en:US:2222222222",
    "offerId": "2222222222",
    "title": "Google Tee Green",
    "description": "100% cotton jersey fabric sets this Google t-shirt above the crowd.
    Features the google logo across the chest. Unisex sizing.",
    "link": "http://my.site.com/greentee/",
    "imageLink": "https://shop.example.com/.../images/GGOEGXXX0906.jpg",
    "contentLanguage": "en",
    "targetCountry": "US",
    "feedLabel": "US",
    "channel": "online",
    "ageGroup": "adult",
    "availability": "in stock",
    "availabilityDate": "2019-01-25T13:00:00-08:00",
    "brand": "Google",
    "color": "green",
    "condition": "new",
    "gender": "male",
    "googleProductCategory": "1604",
    "gtin": "608802531649",
    "itemGroupId": "google_tee",
    "mpn": "608802531649",
    "price": {
     "value": "21.99",
     "currency": "USD"
    },
    "sizes": [
     "Medium"
    ],
    "includedDestination": [
      "Shopping"
    ]
   }
  }
 ]
}

কাস্টমব্যাচ: মুছুন

নিম্নলিখিত অনুরোধ URLটি method=delete সহ একটি products.custombatch তৈরি করতে ব্যবহৃত হয়:

POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch

একটি পণ্য মুছে ফেলতে, এই API কলের মধ্যে পণ্যটির জন্য অনন্য batchId , এই API কল করার জন্য অনুমোদিত বণিকের merchantId , পদ্ধতি delete এবং মুছে ফেলা পণ্যের productId নির্দিষ্ট করুন৷

{
  "entries": [
    {
      "batchId": 1115,
      "merchantId": 1234567,
      "method": "delete",
      "productId": "online:en:US:1111111111"
    },
    {
      "batchId": 1116,
      "merchantId": 1234567,
      "method": "delete",
      "productId": "online:en:US:2222222222"
    }
  ]
}

এই কলটি একটি HTTP 200 কোড এবং মুছে ফেলা আইটেমগুলির batchId মান প্রদান করে:

{
 "kind": "content#productsCustomBatchResponse",
 "entries": [
  {
   "kind": "content#productsCustomBatchResponseEntry",
   "batchId": 1115
  },
  {
   "kind": "content#productsCustomBatchResponseEntry",
   "batchId": 1116
  }
 ]
}