Adwords API Batch Jobs, XML SOAP

111 views
Skip to first unread message

jack.e...@gmail.com

unread,
Jun 15, 2018, 1:22:36 PM6/15/18
to AdWords API and Google Ads API Forum
Hello!

So I am using XML SOAP directly, no client library. I am trying to obtain the resumable URL for my batch job that is created. I post an empty HTTP Request but keep receiving an error about my signature.

Here is my request: 
function getResumableUrl(uploadUrl) {
  var authToken = findAccessToken();
  var xml =  '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' +
     '<soapenv:Header>' +
       '<ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201806" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">' +
         '<ns1:clientCustomerId>INSERT HERE</ns1:clientCustomerId>' +
         '<ns1:developerToken>INSERT HERE</ns1:developerToken>' +
         '<ns1:userAgent>Batch Job Resumable Test</ns1:userAgent>' +
         '<ns1:validateOnly>false</ns1:validateOnly>' +
         '<ns1:partialFailure>true</ns1:partialFailure>' +
       '</ns1:RequestHeader>' +
    '</soapenv:Header>' +
      '<soapenv:Body>' +
        '</soapenv:Body>' +
  '</soapenv:Envelope>';
  
        
  var headers = {
        "content-type": "application/x-www-form-urlencoded",
                 "x-goog-resumable": "start",
                 "expires": test
                };
  
  var options = {
    "Authorization": "Bearer " + authToken,
    "Content-Length ": 0,
    'Method': "post",
    'headers': headers,
    muteHttpExceptions: true,
    payload: xml
  };
  Logger.log(uploadUrl);
  var response = UrlFetchApp.fetch(uploadUrl, options);
  Logger.log(response);
}

Here is the response: 
<?xml version='1.0' encoding='UTF-8'?><Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.</Message><StringToSign>POST

application/x-www-form-urlencoded
1529679903
x-goog-resumable:start
/batch-job-upload-prod-ebe9b43/273175195/763146464.operations.xml</StringToSign></Error>

I have tried so many different variations and have read through all of the documentation. Does anyone see anything that is triggering this? Thank you so much!

Milind Sankeshware (AdWords API Team)

unread,
Jun 15, 2018, 5:24:14 PM6/15/18
to AdWords API and Google Ads API Forum
Hi,

It seems like the error is with the platform from where you were calling the AdWords API. Could you please confirm if you are performing a Resumable Upload Could via Google Cloud? If yes, I found this post about the error that might be helpful for you. If this post won't help you, I would suggest to reach out the Google Cloud Team through their support channels mentioned here. For more information, please refer the AdWords API SOAP request structure in this guide.

Thanks,
Milind, AdWords API Team.

jack.e...@gmail.com

unread,
Jun 16, 2018, 6:37:08 PM6/16/18
to AdWords API and Google Ads API Forum
I am using Google Script Editor in Google Sheets. Still haven't figured it out, any suggestions?

Milind Sankeshware (AdWords API Team)

unread,
Jun 18, 2018, 2:07:52 PM6/18/18
to AdWords API and Google Ads API Forum
Hi Jack,

The Google Script Editor is out of scope for the AdWords API Team. Could you please reach out the team through their support channel mentioned here?
Reply all
Reply to author
Forward
0 new messages