Hello,
I am using .net C# and i want to insert,update and delete share contacts in our
domain email.
I tried with authsub but if I am getting error if i try to retrieve shared
contacts.I can retrieve all personal contacts but i am unable to retrieve
shared contacts.
Please help,
below is my code,
String token = Request.QueryString["token"];
Session["token"] = token;
HttpWebResponse response = null;
string authSubToken = "";
string sessionUrl = getSessionTokenUrl("https", "www.google.com");
Uri uri = new Uri(sessionUrl);
HttpWebRequest request = WebRequest.Create(uri) as HttpWebRequest;
Session["header"] = formAuthorizationHeader(Session["token"].ToString(), null, uri, "GET");
request.Headers.Add(Session["header"].ToString());
request.Headers.Add("GData-Version: 3.0");
response = request.GetResponse() as HttpWebResponse;
if (response != null)
{
int code = (int)response.StatusCode;
if (code != 200)
{
}
// get the body and parse it
authSubToken = Utilities.ParseValueFormStream(response.GetResponseStream(), GoogleAuthentication.AuthSubToken);
}
Session["newtoken"]= authSubToken;
and then i am trying to retrieve contacts by,
HttpWebResponse response = null;
string sessionUrl = "https://www.google.com/m8/feeds/contacts/default/full";
Uri uri = new Uri(sessionUrl);
HttpWebRequest request = WebRequest.Create(uri) as HttpWebRequest;
request.ContentType = "application/x-www-form-urlencoded";
request.UserAgent = "Java/1.5.0_06";
request.Host = "www.google.com";
request.Accept = "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
request.KeepAlive = true;
request.Method = "GET";
string header = formAuthorizationHeader(Session["newtoken"].ToString(), null, uri, "GET");
request.Headers.Add(header);
//request.Headers.Add(Session["header"].ToString());
response = request.GetResponse() as HttpWebResponse;
above is working but if i change url by
https://www.google.com/m8/feeds/contacts/mydomain.com/full
then I am getting error .
Please please please help me,
Thanks
Foram
Original issue reported on code.google.com by forampar...@gmail.com on 4 Sep 2012 at 6:37
Original issue reported on code.google.com by
forampar...@gmail.com
on 4 Sep 2012 at 6:37