1

そのユーザーの管理者アカウントからドメイン ユーザーのデータにアクセスできません...次の URL を試して、Google ドキュメントのドメイン ユーザーのアーカイブを作成しました: 'https://docs.google.com/feeds/[userName]/private /記録'

ドメイン ユーザーの連絡先の詳細を取得するためのこの URL : https://www.google.com/m8/feeds/contacts/[userName]/full"

しかし、うまくいきません...これを行うための提案または別の解決策を教えてください。

for contacts, code is :
 function getContacts(user){
      var scope = 'https://www.google.com/m8/feeds/';
      //oAuth
      user="user@yourdomain.com"

      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"};
    }
4

1 に答える 1

1

Google ドキュメントのネイティブ API を使用してユーザーのフィードにアクセスするコードをいくつか書きました。ここで確認できます。 https://sites.google.com/site/appsscripttutorial/urlfetch-and-oauth/get-the-document-list-of-a-domain-user

同じ概念を拡張して、質問で尋ねた他の目的を実行できます

于 2012-09-21T19:08:02.087 に答える