我正在运行以下代码。它说
UrlFetchApp.fetch()中的意外错误
function archive(){
var oauthConfig = UrlFetchApp.addOAuthService("docs");
oauthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
oauthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope=https://docs.google.com/feeds/");
oauthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken");
oauthConfig.setConsumerKey(consumerkey);
oauthConfig.setConsumerSecret(consumerSecret);
var requestData = {
"method": "POST",
"headers": { "GData-Version": "3.0" },
"oAuthServiceName": "docs",
"payload":getPayload(),
"oAuthUseToken": "always"
};
var url='https://docs.google.com/feeds/default/private/archive'
var result = UrlFetchApp.fetch(url, requestData);
}
function getPayload() {
var xml='<?xml version="1.0" encoding="UTF-8"?>'+
'<atom:entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">'+
'<docs:archiveConversion source="application/vnd.google-apps.document" target="application/msword"/>'+
'<docs:archiveConversion source="application/vnd.google-apps.spreadsheet" target="text/csv"/>'+
'<docs:archiveConversion source="application/pdf" target="application/pdf"/>'+
</atom:entry>';
Logger.log(xml)
return xml;
}
If you have another way to do this, please let me know asap.
Thank you in advance!!