Resource functions
Collection functions
Search functions
IIIF
Metadata functions
User functions
System
Message functions
Plugin functions

do_report

Run a report and return the data using the API.

* Available from version 11.0.

Variable Description Data type
$report_ref * ID of the report to run. integer
$from_date
Start date of reporting period in format YYYY-MM-DD. If not supplied, default will be 7 days ago. string
$to_date Start date of reporting period in format YYYY-MM-DD. If not supplied, default will be today. string

Return values

Returns false if permissions are insufficient to run reports or the date format supplied is incorrect.

Returns array of report data on success, the content depending on the report chosen.

Note: not all reports use the date range provided here. Check the report SQL for confirmation.

Where the report chosen includes a thumbnail column, the returned array will contain two keys:

"thumbnail" -  containing a base64 encoded thumbnail image in jpg format.

"thumbnail_view_resource" - containing a link to the view page for the resource (accessible to logged in users).