I am unable to access data of domain user from admin account of that user...I tried below url to make archive of domain user of google docs : 'https://docs.google.com/feeds/[userName]/private/archive'
and this url to fetch contact detail of domain user : https://www.google.com/m8/feeds/contacts/[userName]/full"
But its not working...Please give some suggestion or some another solution to do this.
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"};
}