| POST,OPTIONS | /v1/dashboard/dispatch |
|---|
import Foundation
import ServiceStack
public class DispatchReportRequest : Codable
{
public var fromDate:Date
public var toDate:Date
public var locationIds:[String] = []
required public init(){}
}
public class DispatchReportResponse : Codable
{
public var stats:[DashboardStatTile] = []
public var unit:String
public var trend:[DispatchReportDayRow] = []
public var byModule:[DispatchReportModuleRow] = []
public var byLane:[DispatchReportLaneRow] = []
public var byTruck:[DispatchReportTruckRow] = []
public var byDriver:[DispatchReportDriverRow] = []
public var jobs:[DispatchReportJobRow] = []
public var incidents:[DispatchReportIncidentRow] = []
public var holds:[DispatchReportHoldRow] = []
public var responseStatus:ResponseStatus
required public init(){}
}
public class DashboardStatTile : Codable
{
public var key:String
public var label:String
public var value:Double
public var previousValue:Double?
public var unit:String
public var deltaPct:Double?
required public init(){}
}
public class DispatchReportDayRow : Codable
{
public var label:String
public var loads:Int
public var revenue:Double
public var pay:Double
public var qty:Double
public var avgCycleMins:Double?
required public init(){}
}
public class DispatchReportModuleRow : Codable
{
public var module:String
public var loads:Int
public var qty:Double
public var revenue:Double
public var pay:Double
required public init(){}
}
public class DispatchReportLaneRow : Codable
{
public var supplierName:String
public var sourceLabel:String
public var loads:Int
public var qty:Double
public var revenue:Double
public var avgCycleMins:Double?
required public init(){}
}
public class DispatchReportTruckRow : Codable
{
public var truckLabel:String
public var driverLabel:String
public var loads:Int
public var qty:Double
public var revenue:Double
public var pay:Double
public var avgCycleMins:Double?
public var daysActive:Int
required public init(){}
}
public class DispatchReportDriverRow : Codable
{
public var driver:String
public var driverContactId:Int?
public var loads:Int
public var qty:Double
public var pay:Double
public var daysActive:Int
public var unpriced:Int
required public init(){}
}
public class DispatchReportJobRow : Codable
{
public var jobCode:String
public var customer:String
public var cargo:String
public var route:String
public var miles:Int
public var revenue:Double?
public var pay:Double?
public var marginPct:Double?
public var closedUtc:Date?
required public init(){}
}
public class DispatchReportIncidentRow : Codable
{
public var kind:String
public var opened:Int
public var resolved:Int
public var avgResolveMins:Double?
required public init(){}
}
public class DispatchReportHoldRow : Codable
{
public var scopeKind:String
public var holds:Int
public var pausedMins:Int
public var weather:Int
public var fromIncidents:Int
required public init(){}
}
Swift DispatchReportRequest 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/dashboard/dispatch HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"FromDate":"0001-01-01T00:00:00.0000000","ToDate":"0001-01-01T00:00:00.0000000","LocationIds":["00000000000000000000000000000000"]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Stats":[{"Key":"String","Label":"String","Value":0,"PreviousValue":0,"Unit":"String","DeltaPct":null}],"Unit":"String","Trend":[{"Label":"String","Loads":0,"Revenue":0,"Pay":0,"Qty":0,"AvgCycleMins":0}],"ByModule":[{"Module":"String","Loads":0,"Qty":0,"Revenue":0,"Pay":0}],"ByLane":[{"SupplierName":"String","SourceLabel":"String","Loads":0,"Qty":0,"Revenue":0,"AvgCycleMins":0}],"ByTruck":[{"TruckLabel":"String","DriverLabel":"String","Loads":0,"Qty":0,"Revenue":0,"Pay":0,"AvgCycleMins":0,"DaysActive":0}],"ByDriver":[{"Driver":"String","DriverContactId":0,"Loads":0,"Qty":0,"Pay":0,"DaysActive":0,"Unpriced":0}],"Jobs":[{"JobCode":"String","Customer":"String","Cargo":"String","Route":"String","Miles":0,"Revenue":0,"Pay":0,"MarginPct":0,"ClosedUtc":"0001-01-01T00:00:00.0000000"}],"Incidents":[{"Kind":"String","Opened":0,"Resolved":0,"AvgResolveMins":0}],"Holds":[{"ScopeKind":"String","Holds":0,"PausedMins":0,"Weather":0,"FromIncidents":0}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}