Hello,
We are trying to access Version One via REST in C# using the HTTPWebRequest class.
We are aware that there are VersionOne .NET SDK available for download, we are having problem with using the SDK due to some environment issues, have already raised a support ticket for the same. But we want an alternate method as well as a backup, should the issue not be resolved.
I am pretty sure that the credentials I provided is correct but not sure why am i getting this Unauthorized error. We are using Integrated Authentication on our Version One instance.
Jotting down the code below, can somebody help us out ?
This is a simple GET Query to get member details.
string Result;
HttpWebResponse response;
request.ContentType = "application/xml";
request.Method = "GET";
string base64Credentials = EncodedCredentials;
request.Headers.Add("Authorization", "Basic " + base64Credentials);
response = request.GetResponse() as HttpWebResponse; // Getting error here
StreamReader reader = new StreamReader(response.GetResponseStream());
Result = reader.ReadToEnd();
response.Close();
Thanks,
Shreyance