我無法從管理帳戶用戶的訪問域用戶的數據...我嘗試下面的網址,使谷歌文檔域用戶的歸檔: 'https://docs.google.com/feeds/[userName]/private/archive'如何從管理員帳戶通過谷歌訪問域用戶的數據應用腳本
和此網址可獲取域用戶的聯繫人詳情: https://www.google.com/m8/feeds /聯繫人/ [用戶名] /滿」
但它不工作...請給一些建議,或者一些其他的解決方案來做到這一點。
for contacts, code is :
function getContacts(user){
var scope = 'https://www.google.com/m8/feeds/';
//oAuth
user="[email protected]"
var fetchArgs = googleOAuth_('contacts', scope);
var url = scope +'contacts/'+ user+'/full?v=3&alt=json';
var urlFetch = UrlFetchApp.fetch(url, fetchArgs);
}
//--------------------------------------------------------------------------------------
//Google oAuth
//Used by getDocuments(user)
function googleOAuth_(name,scope) {
var oAuthConfig = UrlFetchApp.addOAuthService(name);
oAuthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope="+scope);
oAuthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken");
oAuthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
oAuthConfig.setConsumerKey(consumerKey);
oAuthConfig.setConsumerSecret(consumerSecret);
return {oAuthServiceName:name, oAuthUseToken:"always", method: "GET"};
}
見下面就如何檢索目錄聯繫人答案:http://webapps.stackexchange.com/a/35880/ 29140 –