Endpoint - reporting
- Last updated
- Save as PDF
POST /api/v2/reporting/custom
This returns a report when you run a report report schema (xml) in the request body.
- Click the POST /api/v2/reporting/custom line.
- Click the Try it out button.
- In the Edit Value field, enter the XML.
- Click the Execute button.
GET /api/v2/reporting/{id}
This returns a report:
https://[client_instance].serraview.com/api/v2/reporting/{id}
You will need to find the report id, report's secured action, and defined the scope before you can run the GET. Learn more in Extract Data using the Reporting Endpoint.
The following is an example of the GET where you want to use a report number to retrieve the data for a report.
RequestURL:
https://[client_instance].serraview.com/api/v2/reporting/1
This will return:
[ { "id": "Table_60", "headers": [ "Building Information", "Allocation" ], "rows": [ [ "Georgia", "Atlanta", "Atlanta Office", "Corporate", "", "0", "6", "0", "0", "6", "6", "0" ], [ "Massachusetts", "Boston", "Boston Office", "Corporate", "", "1660", "50", "42", "3", "47", "50", "0" ], [ "New York", "New York", "New York Office", "Corporate", "", "251", "25", "12", "0", "25", "25", "0" ], [ "Victoria", "Melbourne", "Melbourne Office", "Corporate", "", "673", "59", "56", "32", "27", "38", "21" ], [ "Zagreb", "Zagreb", "Zagreb Office", "Corporate", "", "263", "30", "0", "0", "30", "30", "0" ] ] } ]
If you receive an error when you use the URL.
https://serraview.serraview.com/api/v2/reporting/1075
And the following error displays, then the type of data requested doesn't line up with what the server is able to provide.
We recommend that you use the URL with .json on the end.
https://serraview.serraview.com/api/v2/reporting/1075.json
And this displays the response.
POST /api/v2/reporting/{id}
This returns a report.
You can specify parameters when you run the report.
You will need to find the report's secured action and defined the scope before you can run the POST. Learn more in Extract Data using the Reporting Endpoint.
Step 1. Set up the report with the parameters
From Serraview complete the following:
- Navigate to Insights > Reporting.
- In the search field, enter the report number.
- Select the report to display the Launch Report form.
- Complete the parameters.
- Click the Copy URL to Clipboard button.
This copies the URL and you will see the parameters are included.
ReportID=345&OutputType=Excel&PageSize=A4&PageOrientation=Portrait&FloorID.IsIn=18&Floors=18&FloorIDs=18&floorSelector=f18&startTime=2023-05-21&endTime=2023-05-23
Step 2. Create the JSON script
In this example, you want to include the Location, Start Time, End Time in the API call, so the JSON script looks like.
{ floorSelector:"f18", startTime:"2023-05-21", endTime:"2023-05-23" }
Step 3. Run the Report
- Click the POST /api/v2/reporting/{id} line.
- Click the Try it out button.
- In the report ID field, enter the report ID.
- In the Edit Value field, enter the JSON script.
- Click the Execute button.