Read timed out when listing accounts for Google Shopping Content API

166 views
Skip to first unread message

Dean Povey

unread,
May 4, 2021, 9:43:52 AM5/4/21
to Google Content API for Shopping
Hi there,

I am frequently encountering errors when attempting to get a list of accounts under a merchant ID in the Google Shopping API.  I am using the Java API.  I frequently encounter a
Read timed out socket error when attempting to call:

ShoppingContent content = ...;
content.accounts().list(merchantID).execute();


It is a bit unclear on how to increase the Read timeout, or what it should be.  I have tried setting an HttpInitializer on the Credential passed in when creating the ShoppingContent as so:

var jsonFactory = JacksonFactory.getDefaultInstance();
var httpTransport = GoogleNetHttpTransport.newTrustedTransport();
var httpRequestInitializer = new HttpRequestInitializer() {
public void initialize(HttpRequest request) {
request.setConnectTimeout(60000);
request.setReadTimeout(10 * 60000);
}
};
var credential = new GoogleCredential.Builder()
.setClientSecrets("secret", "secret")
.setJsonFactory(jsonFactory)
.setTransport(httpTransport)
.setRequestInitializer(httpRequestInitializer)
.build()
.setRefreshToken("refreshToken");

var oauth2 = new Oauth2.Builder(httpTransport, jsonFactory, credential).build();
var userinfo = oauth2.userinfo().get().execute();

var content = new ShoppingContent.Builder(httpTransport, jsonFactory, credential)
.build();


However this does not seem to work, and it still continues to time out after approximately 60 seconds. Any help would be appreciated.

Shopping API Forum Advisor Prod

unread,
May 5, 2021, 2:36:46 AM5/5/21
to dean....@ppcsamurai.com, google-content-...@googlegroups.com

Hello Dean,

 

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

 

For our team to further investigate, could you please provide us the following items below?

  • Merchant account ID
  • The complete API request and response logs in JSON format when you encounter errors while attempting to get a list of sub-account.
  • Screenshots that describe the issue.

 

Kindly provide the requested items via ‘Reply privately to author’ option, if the private option is not available on your end, then please send it over through this email <shopping-a...@google.com> instead.

 

Regards,

Google Logo
James Howell Abarsoza
Content API for Shopping Team
 


ref:_00D1U1174p._5004Q2GJnGG:ref

Shopping API Forum Advisor Prod

unread,
May 5, 2021, 12:15:29 PM5/5/21
to dean....@ppcsamurai.com, google-content-...@googlegroups.com
Hi Dean,

I responded to the thread on which you have sent the details. Please continue your conversation on that thread.

Thanks,
Google Logo
Lakshmi Prathipati
Content API for Shopping Team
 


ref:_00D1U1174p._5004Q2GJnGG:ref

Narendran Omprakash

unread,
Apr 4, 2023, 1:50:04 AM4/4/23
to Google Content API for Shopping

Hello,

I am facing a similar issue in which the API call to list the sub-accounts times out. I used the API Explorer in the references page and also limited the results with the "page results" parameter. Any help on this would be appreciated. 

Thank you,
Narendran 
Reply all
Reply to author
Forward
0 new messages