Skip to content

Cannot use BatchJob to update labels #106

Closed
@sfontana

Description

@sfontana

I'm trying to change a campaignLabel using the BatchJob.
Here https://developers.google.com/adwords/api/docs/guides/batch-jobs#supported_operations is says that CampaignLabel is a supported operation.

Unfortunately this

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201601" xmlns:tns="https://adwords.google.com/api/adwords/cm/v201601" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Header>
      <tns:RequestHeader>
         <tns:clientCustomerId>XXX-XXX-XXXX</tns:clientCustomerId>
         <tns:developerToken>1234567890</tns:developerToken>
         <tns:userAgent>Webrepublic..</tns:userAgent>
         <tns:validateOnly>false</tns:validateOnly>
         <tns:partialFailure>false</tns:partialFailure>
      </tns:RequestHeader>
   </SOAP-ENV:Header>
   <ns0:Body>
      <ns1:mutateLabel>   <----------------------------------------
         <ns1:operations>
            <ns1:operator>ADD</ns1:operator>
            <ns1:Operation.Type>CampaignLabelOperation</ns1:Operation.Type>
            <ns1:operand>
               <ns1:campaignId>436647188</ns1:campaignId>
               <ns1:labelId>448280348</ns1:labelId>
            </ns1:operand>
         </ns1:operations>
      </ns1:mutateLabel>
   </ns0:Body>
</SOAP-ENV:Envelope>

will fail because https://github.com/googleads/googleads-python-lib/blob/master/googleads/adwords.py#L769
return root.find('{http://schemas.xmlsoap.org/soap/envelope/}Body').find( '%smutate' % self._adwords_namespace)
will only look for mutate and not mutateLabel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions