Help trying to update an account using BatchJobServiceClient

111 views
Skip to first unread message

Julian Canada

unread,
Jan 21, 2022, 1:39:45 PM1/21/22
to Google Ads API and AdWords API Forum
Hi! We are migrating from google-adwords API to google-ads API, using the java client.

We have followed this example of the google-ads api, adapting it to only modify the customer creating the objects like this:

Customer customer = Customer.newBuilder()
.setResourceName(ResourceNames.customer(customerId))
.setFinalUrlSuffix("test-suffix")
.setTrackingUrlTemplate("http://wwww.test.com/{lpurl}")
.setDescriptiveName("this-is-a-test")
.build();

CustomerOperation customerOperation = CustomerOperation.newBuilder()
.setUpdate(customer)
.setUpdateMask(FieldMasks.allSetFieldsOf(customer))
.build();

var customerMutateOperation = MutateOperation.newBuilder()
.setCustomerOperation(customerOperation).build();

AddBatchJobOperationsResponse response =
batchJobServiceClient.addBatchJobOperations(
AddBatchJobOperationsRequest.newBuilder()
.setResourceName(batchJobResourceName)
.addMutateOperations(customerMutateOperation)
.build());


However, the batch job never ends and We finish with a TimeoutException after waiting for 2 minutes for this operation.

Could you help us trying to define how to update the account using BatchJobServiceClient?

Thank you ! 

Google Ads API Forum Advisor

unread,
Jan 24, 2022, 8:51:11 AM1/24/22
to julian...@quanticmind.com, adwor...@googlegroups.com

Hi Julian,

 

I'm Kevin from the Google Ads API Team.

 

Regarding a sample code on how to update a customer via BatchJobService, I suggest you reach out to the Java client library authors by posting your concern in this link for further assistance since they are better equipped to assist you with this. I also suggest minimizing your modifications in our sample code in order to better troubleshoot the issue (e.g. you may focus on creating the objects as well as the mutate operations and then, try to implement the rest of our sample code without modification). For additional reference, you may also check out this documentation on the Usage Flow of Batch Processing.

 

Regards,

Google Logo
Kevin Gil Soriano
Google Ads API Team
 


ref:_00D1U1174p._5004Q2VOLNu:ref

Julian Canada

unread,
Jan 26, 2022, 4:35:45 PM1/26/22
to Google Ads API and AdWords API Forum
Hi! We have reached out to the client but they told us to come back here. (Question posted here)

They say that sounds like an issue with the API. What information could we provide to help you triage the issue ?

Thank you !

Google Ads API Forum Advisor

unread,
Jan 27, 2022, 1:41:41 AM1/27/22
to julian...@quanticmind.com, adwor...@googlegroups.com

Hello Julian,

Thanks for getting back to us.

As mentioned by Josh on this link, can you share to us the ID of the batch job (via Reply privately to author) so our team can further check?

Regards,

Google Logo
Mark Kevin Albios
Google Ads API Team
 


ref:_00D1U1174p._5004Q2VOLNu:ref

Julian Canada

unread,
Feb 1, 2022, 9:44:43 AM2/1/22
to Google Ads API and AdWords API Forum
Hi! I was wondering if you had an update for this issue that we are having. Did you receive correctly the id? Do you need more information on our side?

Thank you ! 

Google Ads API Forum Advisor

unread,
Feb 2, 2022, 10:28:36 AM2/2/22
to julian...@quanticmind.com, adwor...@googlegroups.com
Hi Julian,

We did receive the ID, thank you. Did you receive my response on Jan. 28? The case is currently being investigated, but I was wondering if it might be possible to try creating a new batch job and attempting to run it with the same operations. The current job has gotten into a potentially corrupted state and it might not be possible to fix it in the short term.

Thanks,
Ben, Google Ads API Team

ref:_00D1U1174p._5004Q2VOLNu:ref
Reply all
Reply to author
Forward
0 new messages