Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

amien
Valued Contributor

Connecting to the QRS using a specific NTML account gives 401

//Create the HTTP Request and add required headers and content in xrfkey

string xrfkey = "0123456789abcdef";

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"https://servername.com/QRS/about?xrfkey=" + xrfkey);

request.Method = "GET";

request.UserAgent = "Windows";

request.Accept = "application/json";

request.Headers.Add("X-Qlik-xrfkey", xrfkey);

request.UseDefaultCredentials = false;

request.Credentials = new NetworkCredential("username", "secret");

// make the web request and return the content

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

Stream stream = response.GetResponseStream();

Console.WriteLine(new StreamReader(stream).ReadToEnd());

This is my code, but i keep getting a 401 error. Do i need to add another request.?

I tried with request.PreAuthenticate

1 Reply
amien
Valued Contributor

Re: Connecting to the QRS using a specific NTML account gives 401

anyone who already did this?