Hi. What is wrong with this request created by
googleads-python-lib ? What should be sent instead?
I am trying to create a Budged via API on a test account. The BudgetOperation is uploaded successfully but later the BatchJobService is "CANCELED" with "FILE_FORMAT_ERROR". I am using the Python official client, providing dict objects to suds to translate and do the SOAP magic for me.
To ease the troubleshot, I had set the urllib debuglevel to 1, collecting the HTTP wire data from terminal output. This is the request being sent, according to urllib debug: (note that there was a padding of blank added to the end that I had stripped for pasting here)
PUT /216616457/472174997.operations.xml?GoogleAccessId=
926043054183-rbu1gkdus...@developer.gserviceaccount.com&Expires=1491257035&Signature=XEGbNYTS%2FBIdOAZ8A8Sh6cW%2Be%2BwcvibhKlhrIw60BK2xV8ecibBCJgWe%2FxAC6ux0QRHNtXwIfdDyVoZ1GJcCemqlOlwWUqsEGCVSgRF19AI%2FgY9yKm4zj5MiYVRaAXeYq1ynRUl%2B5L8FB%2BQzlcsu5O3z5O%2BzP0lcomigZ5lLkKd6RI9JbmbFmX9Kz9%2BSEunR%2Fo8fVvyU6NW6yNKttaF1PWYNu15dBEzZy8qKZ5Vj%2BQo3UjASRkaJEaX2QqfqDrBz%2FaFStnIULBa7szCpyWbAOP%2B0bSq7gxJiN4r4YM%2BUUn02tY467o0DuW5cwpBvTNgu9q6TMK5L6X4%2BbCbS0J%2Bevw%3D%3D&upload_id=AEnB2UoEloXFDWaD5Satf3mvH0CRn5aC4w61zGQ_RrDn-KSJHb5dxm1CCRJrDEKtYHSY_tjNP_KY1EueXR2zEj4o_GJVrXDMqw HTTP/1.1
Accept-Encoding: identity
User-Agent: Python-urllib/3.5
Content-Type: application/xml
Connection: close
Content-Length: 262144
Content-Range: bytes 0-262143/262144
<?xml version="1.0" encoding="UTF-8"?>
<mutate xmlns="
https://adwords.google.com/api/adwords/cm/v201702" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"><operations xsi:type="BudgetOperation"><operator>ADD</operator><Operation.Type>BudgetOperation</Operation.Type><operand><budgetId>-1</budgetId><name>automatic-452ed0c2-1339-11e7-8e60-0242ac110006</name><amount><ComparableValue.Type>Money</ComparableValue.Type><microAmount>28750000000</microAmount></amount><deliveryMethod>ACCELERATED</deliveryMethod><isExplicitlyShared>true</isExplicitlyShared></operand></operations></mutate>
The operation dict that generated this is:
{'operand': {'amount': {'microAmount': 28750000000, 'xsi_type': 'Money'},
'budgetId': -1,
'deliveryMethod': 'ACCELERATED',
'isExplicitlyShared': True,
'name': 'automatic-452ed0c2-1339-11e7-8e60-0242ac110006',
'xsi_type': 'Budget'},
'operator': 'ADD',
'xsi_type': 'BudgetOperation'}