products.custombatch - Empty response

69 views
Skip to first unread message

Trophée Commerce

unread,
Aug 11, 2021, 5:03:33 PM8/11/21
to Google Content API for Shopping
Hello everyone,

I'm currently trying to simplify my processes using the Google Content API. I used the guides and resources to set me up. I validated with the embedded API call in the following link:


It works wonders and I started to try to reproduce on my side with my code. Basically, I retrieve some JSON from my website, format it correctly and use the API call. In theory, this should work but I get the following response:

{'kind': 'content#productsCustomBatchResponse'}

It's a good thing, as I'm establishing the connection and the response is positive. But without any more guidance, I don't really know what is wrong?

If somebody already encountered this rather empty response, what did you do? Is there something I do wrong?

Thank you in advance for the answer and I wish you a good day,

Virgil D.

Shopping API Forum Advisor

unread,
Aug 12, 2021, 3:11:42 AM8/12/21
to trophee...@gmail.com, google-content-...@googlegroups.com

Hello Virgil,

 

Thank you for reaching out to us. My name is James and I’m from the Content API Team.

 

For us to proceed in our investigation with your issue, can you please provide us with the following information below?

  • Merchant ID
  • Complete API request and response logs in JSON format including HTTP urls when you encounter the empty response logs.
  • Screenshots of the issue.

 

Kindly provide the said information via Reply privately to Author option, if that option is not available on your end, then please send the requested information through this email <shopping-a...@google.com> instead.

 

Regards,

Google Logo
James Howell Abarsoza
Content API for Shopping Team
 


ref:_00D1U1174p._5004Q2LmVgE:ref

Trophée Commerce

unread,
Aug 12, 2021, 6:00:44 AM8/12/21
to Google Content API for Shopping
Hello James,

The option is not available, I will give the necessary info via the mail you provided

Thanks for the support and I wish you a good day,

Virgil D.

Trophée Commerce

unread,
Sep 3, 2021, 8:42:32 AM9/3/21
to Google Content API for Shopping
Without a response from my mail, I respond to the data here

Hello James,

Here is the additional info you requested regarding the topic (https://groups.google.com/g/google-content-api-for-shopping/c/s7dHMxVCXw4)

"

For us to proceed in our investigation with your issue, can you please provide us with the following information below?

  • Merchant ID
  • Complete API request and response logs in JSON format including HTTP urls when you encounter the empty response logs.
  • Screenshots of the issue.
"


- My Merchant Center ID is : 418511207

See image1.png attached

- The website associated with my merchant center is :


- Regarding the technical data, I will give what I think you want. I'm not really experienced yet so feel free to ask for additional data:

See image2.png attached

Here is a screenshot of my code. I used the guides provided in the Google resources for Content API and the code is heavily derived from it

First, I authenticate using my Merchant ID. Then, I extract the JSON from my website using Beautiful Soup. You can find the JSON data at the following link in the website <head> (you can find looking for "Google Shopping Data". During the extraction, I make sure that the format is correct. And then, I send the API call service.products().custombatch(body=batch) using the extracted data. The reason of this code is that the other apps for Shopify creates too many products (including irrevelant ones), hence me searching for direct API interfacing

I don't really know about the HTTP urls as you requested


My data looks like this:


The result looks like this:

See image3.png attached

The exact response is: 

{'kind': 'content#productsCustomBatchResponse'}

The program expects some "entries", hence crashing the program.


I don't really know what is happening. My dataset is quite large (790 products at the moment) and I'm not really sure about the expected format (correctly formatted string? JSON has his own format?), that's the two main points I can think of at the moment.

For the moment, I used the integrated API call at the following link which works well with my data and permitted me to do what I wanted

Thank you in advance for the support and feel free to ask for additional data,


On Thursday, 12 August 2021 at 09:11:42 UTC+2 shoppingapi wrote:
image1.png
image2.png
image3.png

Shopping API Forum Advisor

unread,
Sep 7, 2021, 3:36:05 AM9/7/21
to trophee...@gmail.com, google-content-...@googlegroups.com

Hello Virgil,

 

Thank you for getting back to us. It appears that you have not received our last response. However, let me reiterate my feedback, see context below:

 

“ Can you confirm if you enabled the logging within your application? If not, can you please try to implement the logging within your application by following this guide and observe if you can now retrieve the complete API response logs?

 

Also, can you confirm if you encountered the same empty response logs when using other service - methods? 

Trophée Commerce

unread,
Sep 11, 2021, 10:32:33 AM9/11/21
to Google Content API for Shopping
Hello James,

Thanks for the feedback!

I didn't know about logging, this is good info! I double checked my code (especially variable types) and compared with the insert_batch example. My body was BeautifulSoup type whereas the example body was a dictionnary. I solved this and I'm finally able to communicate with the API

Thank you for the support and I wish you a good day,

Virgil D.

Reply all
Reply to author
Forward
0 new messages