CDR API .Net Call


I need to call the CDR API from a .Net application but i can’t find any documentation on how to build the authentication header.
I tried basic authentication in browser and it works perfectly but when i make the same call from the .Net app the authentication fails.

Basic Authentication URL :

.Net Code


Uri uri = new Uri("");
NetworkCredential credentials = new NetworkCredential("username", "password");
CredentialCache credentialCache = new CredentialCache();
credentialCache.Add(new Uri(@""), "Digest", credentials);

HttpWebRequest request = WebRequest.Create(uri) as HttpWebRequest;
request.PreAuthenticate = true;
request.Credentials = credentialCache;

WebResponse response = request.GetResponse();

catch (WebException wex) { Debug.WriteLine(wex.Message); }
catch (Exception ex) { Debug.WriteLine(ex.Message); }

Please Help, and **Thanks**