Hi Yufeng,
Thanks for responding. I am using the python client out of the box (v 1.3.1). My other requests are working using a service account. Here is some additional information about what is working, and what isn't.
Working API calls with valid responses:
products().get
inventory().set
However, when I use the products.custombatch() method to update a series of products in one call, I get the "kind" response only. The API should be returning "entries" so I can iterate through to find out what made it through, and what batch might have had an issue because of some error. I tried using the API Explorer using the request below (scrubbed data for security reasons). You'll notice I purposely put an empty string for the "gtin" attribute. API Explorer returned a valid response with "entries". However when I use the same JSON request in the python script I don't get the same response... only the "kind" value comes back:
{
"entries" :
[
{
"batchId": 1,
"merchantId" : "xxxxxxx",
"method": "insert",
"product":
{
"id": "online:en:US:1234567",
"offerId": "1234567",
"title": "product title",
"description": "product description",
"link": "mywebsiteURL",
"imageLink": "myimageURL",
"contentLanguage": "en",
"targetCountry": "US",
"channel": "online",
"condition": "new",
"availability": "out of stock",
"brand": "aBrand",
"gtin": "",
"mpn": "manufacturePartNumber",
"price":
{
"currency": "USD",
"value": "123.9900"
},
"productType": "cat1 > cat2 > cat3",
"shippingWeight":
{
"unit": "lb",
"value": "0.0000"
},
"adwordsLabels":
["A","B","C"],
"adwordsRedirect": "myAdwordsRedirect",
"customLabel0": "A",
"customLabel1": "B",
"customLabel2": "C",
"destinations":
[
{
"destinationName": "Shopping",
"intention": "required"
},
{
"destinationName": "ShoppingApi",
"intention": "required"
},
{
"destinationName": "AffiliateNetwork",
"intention": "required"
}
]
}
}
]
}
And got a valid response:
{
"kind": "content#productsCustomBatchResponse",
"entries": [
{
"kind": "content#productsCustomBatchResponseEntry",
"batchId": 1,
"errors": {
"errors": [
{
"domain": "content.ContentErrorDomain",
"reason": "validation",
"message": "[gtin] validation/invalid_value for DisplayAds,Shopping,ShoppingApi: Invalid GTIN value"
}
],
"code": 400,
"message": "[gtin] validation/invalid_value for DisplayAds,Shopping,ShoppingApi: Invalid GTIN value"
}
}
]
}
I noticed the samples on Github does not use products().custombatch to update a collection of batches, but queues up everything
I'll keep plugging away. Any advice would be greatly appreciated.
Dave