Mercedes.VehicleManagement.API

<back to all web services

DashboardCsvReportsRequest

Reports
Requires Authentication
The following routes are available for this service:
POST/v1/reports/CsvRetrieve Report by ReportName and Filters and return as CSV
import Foundation
import ServiceStack

public class DashboardCsvReportsRequest : IPost, Codable
{
    /**
    * Report Name
    */
    // @ApiMember(Description="Report Name", IsRequired=true, ParameterType="body")
    public var reportName:String

    /**
    * Filters
    */
    // @ApiMember(Description="Filters", IsRequired=true, ParameterType="body")
    public var filters:[String:ReportFilter] = [:]

    required public init(){}
}

public class ReportFilter : Codable
{
    public var type:ReportFilterType
    public var values:[String]
    public var start:Date?
    public var end:Date?
    public var higherThan:Int?
    public var lowerThan:Int?

    required public init(){}
}

public enum ReportFilterType : String, Codable
{
    case list
    case list_like
    case date
    case range
}

public class DashboardReportResult : Codable
{
    public var totalCount:Int
    public var reportResult:[String]

    required public init(){}
}


Swift DashboardCsvReportsRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

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/csv
Content-Type: text/csv
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/csv
Content-Length: length

{"totalCount":0}