I create my add operation but the CampaignBidModifierService doesn't have his CampaignBidModifierOperation present in _OPERATION_MAP (line 641) of googleads/adwords.py.
So that raise a KeyError.
~/projects/tool/lib/python3.5/site-packages/googleads/adwords.py in _GenerateRawRequestXML(self, operations)
891 KeyError: If the given operation type is not supported.
892 """
--> 893 operation = self._OPERATION_MAP[operations[0]['xsi_type']]
894 service = self.client.GetService(operation.service, self._version)
895 return service.GetRequestXML(operation.method, operations)
KeyError: 'CampaignBidModifierOperation'
[
{
"xsi_type": "CampaignBidModifierOperation",
"operator": "SET"
"operand": {
"campaignId": 1535056550,
"criterion": {
"Criterion.Type": "InteractionType",
"id": 8000,
"type": "INTERACTION_TYPE"
},
"bidModifier": 2.5,
"xsi_type": "CampaignBidModifier"
},
}
]
INFO 2018-08-30 13:37:18,365 util 16101 139867432646400 Request made: Service: "CampaignBidModifierService" Method: "mutate" URL: "https://adwords.google.com/api/adwords/cm/v201802/CampaignBidModifierService"WARNING 2018-08-30 13:37:18,963 util 16101 139867432646400 Error summary: { "operations": "0", "methodName": "mutate", "faultMessage": "[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ com.google.ads.api.services.common.error.InternalApiError.<init>(InternalApiErro]", "requestId": "000574aa86ccbfc80a3773c6d7042898", "serviceName": "campaign_bid_modifier_service.CampaignBidModifierService", "responseTime": "558"}[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ com.google.ads.api.services.common.error.InternalApiError.<init>(InternalApiErro]
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Header> <ns0:RequestHeader xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201802"> <ns0:clientCustomerId>476-128-0144</ns0:clientCustomerId> <ns0:developerToken>REDACTED</ns0:developerToken> <ns0:userAgent>Ads Python Client Library (AwApi-Python, googleads/11.0.1, Python/3.5.2, zeep)</ns0:userAgent> <ns0:validateOnly>false</ns0:validateOnly> <ns0:partialFailure>false</ns0:partialFailure> </ns0:RequestHeader> </soap-env:Header> <soap-env:Body> <ns0:mutate xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201802"> <ns0:operations> <ns0:operator>SET</ns0:operator> <ns0:operand> <ns0:campaignId>1535056550</ns0:campaignId> <ns0:criterion> <ns0:id>8000</ns0:id> <ns0:type>INTERACTION_TYPE</ns0:type> <ns0:Criterion.Type>InteractionType</ns0:Criterion.Type> </ns0:criterion> <ns0:bidModifier>2.5</ns0:bidModifier> </ns0:operand> </ns0:operations> </ns0:mutate> </soap-env:Body></soap-env:Envelope>
<mutate xmlns="https://adwords.google.com/api/adwords/cm/v201806">
<operations>
<operator>SET</operator>
<operand>
<campaignId>1535056550</campaignId>
<criterion xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201806" xsi:type="ns2:InteractionType">
<ns2:id>8000</ns2:id>
<ns2:type>INTERACTION_TYPE</ns2:type>
</criterion>
<bidModifier>2.5</bidModifier>
</operand>
</operations>
</mutate>
"criterion": {
"Criterion.Type": "InteractionType", # This line was not good. I should write "xsi_type": "InteractionType"
"id": 8000,
"type": "INTERACTION_TYPE"
},