Hi how can I call this API
http://YOUR_SERVER_URL/PATH_TO_SITE_CONTAINING_LIST/_vti_bin/owssvr.dll?Cmd=ExportList&List={YOUR_LIST_GUID}
from Console Application
I used below Code
string ListExportURL = http://YOUR_SERVER_URL/PATH_TO_SITE_CONTAINING_LIST/_vti_bin/owssvr.dll?Cmd=ExportList&List={YOUR_LIST_GUID};
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(ListExportURL);
System.Net.NetworkCredential credentialCache = new System.Net.NetworkCredential(username, password);
webRequest.Credentials = credentialCache;
webRequest.Method = "GET";
webRequest.ContentType = "text/xml";
HttpWebResponse res = webRequest.GetResponse() as HttpWebResponse;
Stream strem = res.GetResponseStream();
StreamReader reader = new StreamReader(strem);
string xmlResult= reader.ReadToEnd();
I am getting an error 403 forbidden. anyone please help