Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Contacts Data Api 401 error
    primarykey
    data
    text
    <p>I am using Google Contacts Data Api to get all user contacts following the documentation here <a href="https://developers.google.com/google-apps/contacts/v3/" rel="nofollow noreferrer">https://developers.google.com/google-apps/contacts/v3/</a></p> <p>first i used Google Auth to authenticate users to the application using the following code </p> <pre><code>string authSubUrl = AuthSubUtil.getRequestUrl("http://localhost:62439/ContactImporter/GoogleContacts.aspx", "https://www.google.com/m8/feeds/", true, true); Response.Redirect(authSubUrl); </code></pre> <p>second after user successfully loged in i redirect to GoogleContacts.aspx page with request token provided from Google and then trying to get contacts by the following code</p> <pre><code>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&lt;Contact&gt; f = cr.GetContacts(); foreach (Contact entry in f.Entries) { foreach (EMail email in entry.Emails) { Response.Write("\n" + email.Address); } } } </code></pre> <p>that code was working from about 4 or 5 days but now its not working and gets me the following error</p> <blockquote> <p>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&amp; contentLength) at Google.GData.Client.Service.Query(Uri queryUri, DateTime ifModifiedSince) at Google.GData.Client.Service.Query(FeedQuery feedQuery) at Google.GData.Client.Feed<code>1.get_AtomFeed() at Google.GData.Client.Feed</code>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)</p> </blockquote> <p>Any suggestions on how to resolve that error?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload