Hi,
I have a problem using the BatchJobService.
My environment is Python3.5 and I am using the latest version of googleads, and accessing the API version v201603
I am trying to perform a series of campaign operations using the batch job service, here is my code.
def upload_batch_operations(self, batch_job, operations, func=None):
batch_job_helper = self.client.GetBatchJobHelper()
# Retrieve the URL used to upload the BatchJob operations.
upload_url = batch_job['uploadUrl']['url']
batch_job_id = batch_job['id']
incremental_uploader = batch_job_helper.GetIncrementalUploadHelper(upload_url)
# batch_job_helper.UploadOperations(upload_url, operations)
incremental_uploader.UploadOperations([operations], is_last=True)
I have tried using both the UploadOperations functions from the incremental and normal function (commented out above)
For creation of the operations -->
def campaign_status_operations(self, campaign_ids, status):
# Construct operations and update campaign.
operations = [{
'xsi_type': 'CampaignOperation',
'operator': 'SET',
'operand': {
'id': campaign_id,
'status': status,
}
} for campaign_id in campaign_ids if campaign_ids]
return operations
I have executed this code successfully several times in the past using version v201506, up until this month.
Was a lot changed in the new version that could cause this file format error?
I am not even uploading a file.
Thanks,
Bo