AnsweredAssumed Answered

Pagination problem, limited records

Question asked by ZELIANG YAO on Mar 27, 2020
Latest reply on Apr 2, 2020 by darkmatter

I would like to ask a question about limitation of records (Global IT Asset Inventory API), I want to list host details for specific fields , with the help of this API documentation : https://www.qualys.com/docs/qualys-global-ai-api-user-guide.pdf  on page 37, I got the first 100 records. but when I tried to get the next 100 records by adding the lastSeenAssetId parameter , it doesn't work , it returns always the first 100 records.

 

Is there anyone can help me out ?

 

My first request successful:

 

url = 'https://gateway.qg1.apps.qualys.com/am/v1/assets/host/filter/list'

headers = {
'Accept': '*/*',
'Authorization': <my token>
'Content-Type':'application/json',
}

 

data={
"includeFields":("address",'assetName','dnsName','netbiosName','networkInterface','operatingSystem','software'),
}

response = requests.post(url, headers=headers, data=data)

 

My second request for next 100 records (only add the lastSeenAssetId in parameter):

 

data={
"includeFields":("address",'assetName','dnsName','netbiosName','networkInterface','operatingSystem','software'),
'lastSeenAssetId':32616487 }

 

 

The second request returns the same result as the first call, I got lastSeenAssetId by using response.json()['lastSeenAssetId']

 

 

Need help here !

 

Thanks

Outcomes