I'm new to Qualysguard tool . Could anybody tell me how to call Qualysguard tool API using Java programming.
Thanks & Regards,
Welcome to the Qualys community.
The best approach to calling our APIs from Java would involve an HTTP client library like the Apache HttpClient or a JAX-RS client. Here's an example from an older thread that shows how to log in and log out using HttpClient:
All the API calls are documented under the Developer Resources linked of the front page of our developer community page:
The main API for our VM and PC products is the "V2" API.
One thing to watch out for is using the correct base URL for the platform where your subscription is hosted. Some of the API examples will have a platform URL hardcoded that you might need to swap out. Here are the base URLs for each platform:
US Platform 1 - https://qualysapi.qualys.com
US Platform 2 - https://qualysapi.qg2.apps.qualys.com
EU Platform - https://qualysapi.qualys.eu
Hopefully that will get you started. Good luck and let us know if you run into trouble.
I have started calling the Qualys guard API using the Java source from the below link which you have given
I'm facing the NullPointerException while running the same source.
Could you please let me know, Is there any set up need to be done...
Hi Sowmya, httpbuilder is supported by Java. Check out the Groovy example:
Qualys API client examples
Now I'm able to login to the Qualus guard API using the Java source from below link
But I'm getting the following exception while logout from the session
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE SIMPLE_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/simple_return.dtd">
java.io.IOException: Server returned HTTP response code: 403 for URL: https://qualysapi.qualys.com/api/2.0/fo/session/
Could you please let me know what is the issue with the logout from the session.
What's the url that you are calling? A 403 HTTP status code means that you are trying to access an object you don't have permission to, likely a bad url.
Retrieving data ...