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.
function getResumableUrl(uploadUrl) {
var authToken = findAccessToken();
'<soapenv:Header>' +
'<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);
}
<?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!