2011-08-09 6 views
8

私が最初に私は次のコードGoogleの連絡先データアピ401エラー

string authSubUrl = AuthSubUtil.getRequestUrl("http://localhost:62439/ContactImporter/GoogleContacts.aspx", "https://www.google.com/m8/feeds/", true, true); 
    Response.Redirect(authSubUrl); 
を使用してアプリケーションにユーザーを認証するためにGoogleの認証を使用し、ここで https://developers.google.com/google-apps/contacts/v3/

ドキュメント以下のすべてのユーザーの連絡先を取得するには、Googleの連絡先データAPIを使用しています

二成功した私にlogedユーザーがGoogleから提供されたリクエストトークンとGoogleContacts.aspxページにリダイレクトし、次のコード

if (!string.IsNullOrEmpty(Request["token"])) 
{ 
    GAuthSubRequestFactory authFactory = new GAuthSubRequestFactory("cp", "alpha"); 
    RequestSettings rs = new Google.GData.Client.RequestSettings("alpha",Request["token"]); 
    ContactsRequest cr = new ContactsRequest(rs); 

    Feed<Contact> f = cr.GetContacts(); 

    foreach (Contact entry in f.Entries) 
    { 
     foreach (EMail email in entry.Emails) 
     { 
      Response.Write("\n" + email.Address); 
     } 
    } 
} 
で連絡先を取得しようとした後、

そのコードは、約4または5日から仕事をしていたが、今のは働いていないと私は次のエラー

The remote server returned an error: (401) Unauthorized. at Google.GData.Client.GDataRequest.Execute() at Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter) at Google.GData.Client.GDataGAuthRequest.Execute() at Google.GData.Client.Service.Query(Uri queryUri, DateTime ifModifiedSince, String etag, Int64& contentLength) at Google.GData.Client.Service.Query(Uri queryUri, DateTime ifModifiedSince) at Google.GData.Client.Service.Query(FeedQuery feedQuery) at Google.GData.Client.Feed 1.get_AtomFeed() at Google.GData.Client.Feed 1.d__0.MoveNext() at GoogleContacts.Page_Load(Object sender, EventArgs e) in d:\Working Folder\API's\ContactImporter\GoogleContacts.aspx.cs:line 25 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

そのエラーを解決する方法上の任意の提案を取得しますか?

+0

http://code.google.com/apis/contacts/docs/3.0/developers_guide.htmlページが見つかりません –

+0

トピックはGoogleフォーラム[here](http://productforums.google.com)で開始されました/ forum /#!topic/gmail/-qeBgCFsRhs)。多分Googleは私たちの質問に答えるでしょう... – Max

+0

完全なソースコードサンプルを使った最終解決策はどれですか? – Kiquenet

答えて

2

これはあなたが探している答えではありませんが、私はあなたの心を休めることができます。 コードに問題はありません。 Googleは最近、通知なしにContacts APIサービスを停止しました。 彼らはそれが古くなったのか何か他の理由でそれを取り除いたのか誰も知らない。 昨日時点で、APIドキュメントをダウンさせていました。しかし、そのリンクはAPIのリストhttps://developers.google.com/google-apps/app-apisにまだ掲載されていますが、それはGoogleが何故それがシャットダウンされたのか、何の説明もなくなっています。うまくいけば、それは恒久的なものではありません。 Googleはまだこの問題について開発者に答えていません。

+0

賞金の期限が切れる前に私はこの返事に気付きました。それは実際に質問に答えます。寂しかったわ。 – jettero

+0

今日までまだダウンしていますか? –

関連する問題