Sep 27, 2021
Customers may need to automate the delivery of the standard Platform MI report, to assist with integration into other services.
With the Whitespace Platform this is straightforward, though it requires a small amount of technical expertise.
The MI report can be run via API call as follows
- Get an API token by following the instructions linked below:
- Store the token in an environment variable - e.g.:
- EXPORT TOKEN=<value from step 1>
- Call the API to prepare the report data:
curl -H "Authorization: Bearer $TOKEN" -X POST https://www.whitespaceplatform.com/mireport/prepare
- Call the API to return the generated XLSX/CSV file:
curl -H "Authorization: Bearer $TOKEN" -OJ -X POST -d '{"format":"xlsx","layout":"wide"}' https://www.whitespaceplatform.com/mireport/fetch
- Options for format are
xlsx
orcsv
- Options layout are
tall
orwide
In practice it may be necessary to introduce a delay between the call to prepare the data and the call to return the report output (XLSX or CSV), in order for the data generation to complete.
The above may be timed to run at regular intervals (for example, nightly), using Scheduler, CRON or similar.