Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
public static DataSet GetGmailContacts(string App_Name, string Uname, string UPassword)
        {
            DataSet ds = new DataSet();
           

              

                DataTable dt = new DataTable();
                DataColumn C2 = new DataColumn();
                C2.DataType = Type.GetType("System.String");
                C2.ColumnName = "EmailID";
                dt.Columns.Add(C2);
                try
                {

                RequestSettings rs = new RequestSettings(App_Name, Uname, UPassword);
                rs.AutoPaging = true;

                ContactsRequest cr = new ContactsRequest(rs);
                Feed<contact> f = cr.GetContacts();

                foreach (Contact t in f.Entries)
                {
                    foreach (EMail email in t.Emails)
                    {
                        DataRow dr1 = dt.NewRow();

                        dr1["EmailID"] = email.Address.ToString();

                        dt.Rows.Add(dr1);

                    }



                }

            }
            catch (Exception ex)
            {
                string str;
                str = ex.Message;
            }

                ds.Tables.Add(dt);



                return ds;
           
        }








This code was working perfectly fine until about 15 days ago and I have been using this code for the last 7 or 8 months, but now suddenly I am facing the error

Execution of authentication request returned unexpected result: 404.


When I searched google. I have searched alot but could not find any solution. Any help or guidance will be greatly appreciated.
Posted
Updated 24-Aug-15 0:37am
v2
Comments
Herman<T>.Instance 24-Aug-15 6:36am    
404 is an error from a webserver
Richard Deeming 24-Aug-15 8:53am    
Sounds like you're still using the old authentication API, which has been retired.

There are several suggestions in this SO thread: https://stackoverflow.com/questions/30469058/google-gdata-client-gdatarequestexception-authentication-suddenly-fails-in-old[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900