swayam rath

Session Login/Logout

Discussion created by swayam rath on Jul 29, 2015
Latest reply on Jul 30, 2015 by Jeff Leggett

Hello All,


I am writing a piece of C# code to get some data from QG.



            var client = new RestClient("https://qualysapi.qualys.com");

            // Set up credentials. 

          client.Authenticator = new HttpBasicAuthenticator("username", "password");

          var request = new RestRequest("/api/2.0/fo/scan", Method.POST);

          request.AddHeader("X-Requested-With", "RestSharp");

          request.AddParameter("action", "list");

          IRestResponse response = client.Execute(request);

          var xml_result = response.Content;


this sample code i got from the community.

What i want to understand is, if this is the way of inputting Username and Password to call the ReST API V2.0, then what is the need of  Session Login and Session Logout API?

And how we can use it in a c# code.

Thanks and Regards,