| POST,OPTIONS | /v1/dashboard/kpiv2 |
|---|
import Foundation
import ServiceStack
public class KpiV2Request : Codable
{
public var fromDate:Date
public var toDate:Date
public var locationIds:[String] = []
required public init(){}
}
public class KpiV2Response : Codable
{
public var responseStatus:ResponseStatus
public var stats:[DashboardStatTile] = []
public var trend:[DashboardSeries] = []
public var servicesByType:DashboardSeries
public var locationLeaderboard:[KpiV2LocationRow] = []
public var workerProductivity:[KpiV2WorkerRow] = []
public var heatmap:[KpiV2HeatPoint] = []
public var liveQueue:[KpiV2LiveRow] = []
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 DashboardSeries : Codable
{
public var name:String
public var points:[DashboardSeriesPoint] = []
required public init(){}
}
public class DashboardSeriesPoint : Codable
{
public var label:String
public var value:Double
required public init(){}
}
public class KpiV2LocationRow : Codable
{
public var locationName:String
public var walkins:Int
public var completed:Int
public var avgServiceMinutes:Double
public var abandonmentPct:Double
required public init(){}
}
public class KpiV2WorkerRow : Codable
{
public var workerName:String
public var completed:Int
public var avgServiceMinutes:Double
required public init(){}
}
public class KpiV2HeatPoint : Codable
{
public var dow:Int
public var hr:Int
public var cnt:Int
required public init(){}
}
public class KpiV2LiveRow : Codable
{
public var locationName:String
public var waiting:Int
public var inProgress:Int
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/dashboard/kpiv2 HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
Content-Type: application/json
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: application/json
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Stats":[{"Key":"String","Label":"String","Value":0,"PreviousValue":0,"Unit":"String","DeltaPct":null}],"Trend":[{"Name":"String","Points":[{"Label":"String","Value":0}]}],"ServicesByType":{"Name":"String","Points":[{"Label":"String","Value":0}]},"LocationLeaderboard":[{"LocationName":"String","Walkins":0,"Completed":0,"AvgServiceMinutes":0,"AbandonmentPct":0}],"WorkerProductivity":[{"WorkerName":"String","Completed":0,"AvgServiceMinutes":0}],"Heatmap":[{"Dow":0,"Hr":0,"Cnt":0}],"LiveQueue":[{"LocationName":"String","Waiting":0,"InProgress":0}]}