Skip to main content

Report Service

The report service gives you access to reports generated from the report configurations

Report REST API

The report REST API is a full CRUD API and is accessed through the following URL:

https://api.opendatadsl.com/api/report

The API consists of the following calls:

MethodPathExampleDescription
GETGet the build information for this service
GET{release}/{source}'v1/public' 'v1/private'List public or private reports
GET{release}/{source}/{key}v1/private/TESTGet a ReportDates timeseries containing the dates for which the report is available
GET{release}/{source}/{key}:{ondate}v1/private/TEST:2024-06-12Retrieve the latest version of the report for the supplied date
GET{release}/{source}/{key}:{ondate}/{version}v1/private/TEST:2024-06-12/1Retrieve a version of a report for the supplied date
GET{release}/{source}/{key}:{ondate}/*v1/private/TEST:2024-06-12/*Get a list of versions for a specific report for the supplied date
PUT{release}/{source}/{key}:{ondate}/{version}/{tag}v1/private/TEST:2024-06-12/1/PRODTag a version with a name (which can be used instead of the version number when retrieving it)
POST{release}/{source}/{key}:{ondate}v1Update a manual report, the data is in the body of the POST request
POST{release}/{source}/{key}:{ondate}v1Run the report, the POST body must be empty
DELETE{release}/{source}/{key}:{ondate}v1/private/TESTDelete a report version, this has the effect of rolling back to the previous version
DELETE{release}/{source}/{key}:{ondate}/{version}v1/private/TEST:2024-06-12/1Delete a version of a report
DELETE{release}/{source}/{key}:{ondate}/*v1/private/TEST:2024-06-12/*Fully delete a report, including all versions

Entities

Report

A report is a Report Configuration with the following additional proeprties:

NameDescriptionType
ondateThe date of the reportString
dataThe actual data for the report, can be any json dataObject
scriptVersionThe version of the script used to run this reportInteger
errorMessageThe error message if this report failed to runString
startThe start date used for the reportString
endThe end date used for the reportString

Examples

### Get build info
GET {{url}}/report
Authorization: Bearer {{token}}

### List all private reports
GET {{url}}/report/v1/private
Authorization: Bearer {{token}}

### List all private report names
GET {{url}}/report/v1/private?_project=name
Authorization: Bearer {{token}}

### Get a list of report dates
GET {{url}}/report/v1/private/METRICS
Authorization: Bearer {{token}}

### Dynamically run a report using the default range
GET {{url}}/report/v1/private/METRICS
?_run=true
Authorization: Bearer {{token}}

### Dynamically run a report using a specified range
GET {{url}}/report/v1/private/METRICS
?_run=true
&_range=between(2023-01-01,2023-05-28)
Authorization: Bearer {{token}}

### Run and save a report - with ondate and range
POST {{url}}/report/v1/private/TEST3:2023-07-01
?_range=between(2023-05-18,2023-05-18T23:59:59)
Authorization: Bearer {{token}}

### Get a dated report
GET {{url}}/report/v1/private/METRICS:2023-05-18
Authorization: Bearer {{token}}

### Get a dated report HTML
GET {{url}}/report/v1/private/METRICS:2023-05-18
Authorization: Bearer {{token}}
Accept: text/html

### Get a dated report version
GET {{url}}/report/v1/private/METRICS:2023-05-18/1
Authorization: Bearer {{token}}

### Get a list of dated report versions
GET {{url}}/report/v1/private/METRICS:2023-05-18/*
Authorization: Bearer {{token}}

### Tag a dated report version
PUT {{url}}/report/v1/private/METRICS:2023-05-18/1/PROD
Authorization: Bearer {{token}}

### Get a tagged dated report version
GET {{url}}/report/v1/private/METRICS:2023-05-18/PROD
Authorization: Bearer {{token}}

### Delete a version of a report
DELETE {{url}}/report/v1/private/METRICS:2023-05-18
Authorization: Bearer {{token}}

### Fully delete a report date
DELETE {{url}}/report/v1/private/METRICS:2023-05-18/*
Authorization: Bearer {{token}}