I am building a custom connector and have managed to get it to get the data a parse (excluding columns which contain gaps). the data I have got so far though is page 1 of 51. Is there any sample code which can cycle around pulling in all the pages of data i.e. mine so far is:
else if (metadata.report == "Vulnerabilities"){
var res = httprequest.get("https://api.appcheck-ng.com/api/v1/"+metadata.account.apikey+"/vulnerabilities");
//display result
DOMO.log(res);
//Parse data
if(httprequest.getStatusCode() == 200) {
var jsonRes = JSON.parse(res).data;
datagrid.addColumn('Category', datagrid.DATA_TYPE_STRING);
datagrid.addColumn('Impact', datagrid.DATA_TYPE_STRING);
datagrid.addColumn('Target', datagrid.DATA_TYPE_STRING);
datagrid.addColumn('Probability', datagrid.DATA_TYPE_STRING);
datagrid.addColumn('Title', datagrid.DATA_TYPE_STRING);
datagrid.addColumn('Priority', datagrid.DATA_TYPE_STRING);
datagrid.addColumn('Host', datagrid.DATA_TYPE_STRING);
datagrid.addColumn('Port', datagrid.DATA_TYPE_STRING);
for(var i=0 ; i<jsonRes.length ; i++) {
datagrid.addCell(jsonRes[i].category);
datagrid.addCell(jsonRes[i].impact);
datagrid.addCell(jsonRes[i].target);
datagrid.addCell(jsonRes[i].probability);
datagrid.addCell(jsonRes[i].title);
datagrid.addCell(jsonRes[i].priority);
datagrid.addCell(jsonRes[i].host);
datagrid.addCell(jsonRes[i].port);
datagrid.endRow();
}
}
}
but, this is just the start as the initial response is:
{"count": 2731, "success": true, "results": 250, "pages": 51, "message": "Vulnerabilities found: 2731 Showing: 250 Page: 1 of 51", "data": [{"category": "xxxx", "impact": "low", "target": "xxxx", "probability": "low", "title": "xxxx", "priority": "low", "host": "xxxx.com", "vuln_id": "xxxxxxxxxxxxxxxxxxxxxxxx", "parameter": "cookie.ex_v", "port": 443}, ……..
I can add "?page=2"); so know I can select pages:
{"count": 2731, "success": true, "results": 250, "pages": 51, "message": "Vulnerabilities found: 2731 Showing: 250 Page: 2 of 51", "data": [{"
Thanks