AnsweredAssumed Answered

C# and API v2

Question asked by M_Jones on Nov 20, 2013
Latest reply on Nov 22, 2013 by Parag Baxi

I'm new to the Qualys API and have been trying to follow some examples with C#.

 

I've been able to get some of V1 examples to work using the new RestClient.  But I can't seem to get anything to work with V2.  It returns useless information.

 

The following is my code:

 

var client = new RestClient();

client.BaseUrl = "https://qualysapi.qualys.com";

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

var request = new RestRequest(Method.POST);

request.Resource = "api/2.0/fo/asset/host/";

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

IRestResponse response = client.Execute(request);

 

No matter what resource I request, it returns a web page with java script for Adobe Robohelp 8 saying it has found a low end browser and the color depth is set to low.

 

The response looks like it's coming from:

 

-        ResponseUri    {https://qualysguard.qualys.com/qwebhelp/fo_help/index.htm}    System.Uri

Outcomes