| POST | /v1/reports/Csv | Retrieve Report by ReportName and Filters and return as CSV |
|---|
package dtos
import (
"time"
)
type DashboardReportResult struct {
TotalCount int `json:"totalCount,omitempty"`
ReportResult []interface{} `json:"reportResult"`
}
type ReportFilterType string
const (
ReportFilterTypelist ReportFilterType = "list"
ReportFilterTypelist_like = "list_like"
ReportFilterTypedate = "date"
ReportFilterTyperange = "range"
)
type ReportFilter struct {
Type ReportFilterType `json:"type,omitempty"`
Values []string `json:"values"`
Start *time.Time `json:"start,omitempty"`
End *time.Time `json:"end,omitempty"`
HigherThan *int `json:"higherThan,omitempty"`
LowerThan *int `json:"lowerThan,omitempty"`
}
type DashboardCsvReportsRequest struct {
/** @description Report Name */
// @ApiMember(Description="Report Name", IsRequired=true, ParameterType="body")
ReportName string `json:"reportName"`
/** @description Filters */
// @ApiMember(Description="Filters", IsRequired=true, ParameterType="body")
Filters map[string]ReportFilter `json:"filters"`
}
Go DashboardCsvReportsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/reports/Csv HTTP/1.1
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"reportName":"String","filters":{"String":{"type":"list","start":"\/Date(-62135596800000-0000)\/","end":"\/Date(-62135596800000-0000)\/","higherThan":0,"lowerThan":0}}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"totalCount":0}