How to get "AuthSub " token in C#? For google APPS Contacts ?
- by Pari
Hi,
I fount this code on net :
HttpWebRequest update = (HttpWebRequest)WebRequest.Create(**editUrl** ); // editUrl is a string containing the contact's edit URL
update.Method = "PUT";
update.ContentType = "application/atom+xml";
update.Headers.Add(HttpRequestHeader.Authorization, "GoogleLogin auth=" + **AuthToken**);
update.Headers.Add(HttpRequestHeader.IfMatch, **etag**); // etag is a string containing the <entry> element's gd:etag attribute value
update.Headers.Add("GData-Version", "3.0");
Stream streamRequest = update.GetRequestStream();
StreamWriter streamWriter = new StreamWriter(streamRequest, Encoding.UTF8);
streamWriter.Write(entry); // entry is the string representation of the atom entry to update
streamWriter.Close();
WebResponse response = update.GetResponse();
But here i am not getting what to put in " editurl" , "AuthToken" and "Etag".
a) I studied abt "AuthToken" from this Link .But not getting how to create it?
Can anyone help me out here?
b) Also not getting " editurl" and "Etag".
I am trying to use this method to Migrate my contacts to Google Apps.
Thanx