I am trying to get the list of documents available but failed with an exception "The remote server returned an error: (401) Unauthorized."
Any help would be much appreciated!
Below is the code snippet
--------------------------------------
static void Main(string[] args)
{
GDataGAuthRequestFactory authFactory = new GDataGAuthRequestFactory("cl", "DocumentServiceSample");
authFactory.AccountType = "HOSTED";
Service service = new DocumentsService("DocumentServiceSample");
service.RequestFactory = authFactory;
service.setUserCredentials(@"
xxxx...@gmail.com", @"xxxxxxxx");
string str1 = service.QueryClientLoginToken();
DocumentsListQuery query = new DocumentsListQuery();
AtomFeed feed = service.Query(query);
string str = feed.Entries[0].XmlName;
foreach (DocumentEntry entry in feed.Entries)
{
Console.WriteLine("FileName:{0}", entry.Title.Text);
}
}
regards,
nagaraj