→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JasonB48
Engaged Sweeper

Our company has recently started using the Lansweeper cloud service.

We would like to export the data from custom reports that IT have built.

I have the API working using postman. I can see a test custom report listed along with its report ID.

The documentation seems to only show calls to get the status of executions of the report.

However I would like to get the actual data out from the report.

Is this a supported option?

If so, What query should I use to 1. to interrogate what fields a report has and also to then extract those fields.

Any help appreciated.

Thanks

Jason

1 ACCEPTED SOLUTION
DiegoPacini
Product Team
Product Team

Hello @JasonB48 . Sure you can! Have a look at the reportExecutionResults query here: https://docs.lansweeper.com/docs/api/working-with-reports#getting-the-latest-reports-execution

The reportExecutionStatus that you mention is used to check the status of the report execution that you trigger with the previous call. https://docs.lansweeper.com/docs/api/working-with-reports#getting-a-reports-status

I hope this helps

View solution in original post

4 REPLIES 4
KerryJohnson
Engaged Sweeper

You're on the right track with Postman, but I totally get why you'd want to extract the actual report data. I ran into a similar issue last year when trying to pull data from another API, and I had to dig a bit deeper into the query options. One thing I did find helpful was using tools like the Identity Verification API to confirm the integrity of the data I was pulling.


@KerryJohnson wrote:

You're on the right track with Postman, but I totally get why you'd want to extract the actual report data. I ran into a similar issue last year when trying to pull data from another API, and I had to dig a bit deeper into the query options. One thing I did find helpful was using tools like the Identity Verification API to confirm the integrity of the data I was pulling.


It might not directly apply to your Lansweeper report queries, but it helped me think about better ways to handle the data extraction side of things. You can check it out at https://www.idanalyzer.com. Not sure if it’s the same scenario for you, but it worked wonders for my project.

JasonB48
Engaged Sweeper

Thanks Diego,

Reading through this documentation again, I finally realised that the data is in the URL generated (It downloads it as a csv). I was expecting it to be like the normal calls to entities, where you need to specify the schema and get back a json result set. However this approach is fine, I can programmatically download the csv's and then import them into our data warehouse. 

Thanks again for your help.

 

DiegoPacini
Product Team
Product Team

Hello @JasonB48 . Sure you can! Have a look at the reportExecutionResults query here: https://docs.lansweeper.com/docs/api/working-with-reports#getting-the-latest-reports-execution

The reportExecutionStatus that you mention is used to check the status of the report execution that you trigger with the previous call. https://docs.lansweeper.com/docs/api/working-with-reports#getting-a-reports-status

I hope this helps