AnsweredAssumed Answered

List all Asset IDs with Python APIv2

Question asked by Kathryn Amaral on Nov 20, 2018
Latest reply on Nov 27, 2018 by Kathryn Amaral

Hello,
I am writing a python script to query all assets in Qualys.

 

Asset endpoint URL: /qps/rest/2.0/get/am/hostasset/

 

I need to first list all Asset IDs in the entire system and then loop through those IDs get the details for each one.


According to this answered question here, this can be done with a POST request and XML criteria. The answer shows an example using POSTMAN.

 

https://community.qualys.com/thread/18599-whats-the-api-to-list-all-asset-ids

 

However, how can I do this with the qualysapi python module? I tried sending the criteria with parameters but that did not work.

 

The Python client examples do not have any examples with filtering by criteria.

 

https://community.qualys.com/docs/DOC-4523-qualys-api-client-examples

Outcomes