| POST,OPTIONS | /v1/dashboard/kpiv2 |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class KpiV2Request
{
public Date FromDate = null;
public Date ToDate = null;
public ArrayList<UUID> LocationIds = new ArrayList<UUID>();
public Date getFromDate() { return FromDate; }
public KpiV2Request setFromDate(Date value) { this.FromDate = value; return this; }
public Date getToDate() { return ToDate; }
public KpiV2Request setToDate(Date value) { this.ToDate = value; return this; }
public ArrayList<UUID> getLocationIds() { return LocationIds; }
public KpiV2Request setLocationIds(ArrayList<UUID> value) { this.LocationIds = value; return this; }
}
public static class KpiV2Response
{
public ResponseStatus ResponseStatus = null;
public ArrayList<DashboardStatTile> Stats = new ArrayList<DashboardStatTile>();
public ArrayList<DashboardSeries> Trend = new ArrayList<DashboardSeries>();
public DashboardSeries ServicesByType = null;
public ArrayList<KpiV2LocationRow> LocationLeaderboard = new ArrayList<KpiV2LocationRow>();
public ArrayList<KpiV2WorkerRow> WorkerProductivity = new ArrayList<KpiV2WorkerRow>();
public ArrayList<KpiV2HeatPoint> Heatmap = new ArrayList<KpiV2HeatPoint>();
public ArrayList<KpiV2LiveRow> LiveQueue = new ArrayList<KpiV2LiveRow>();
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public KpiV2Response setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
public ArrayList<DashboardStatTile> getStats() { return Stats; }
public KpiV2Response setStats(ArrayList<DashboardStatTile> value) { this.Stats = value; return this; }
public ArrayList<DashboardSeries> getTrend() { return Trend; }
public KpiV2Response setTrend(ArrayList<DashboardSeries> value) { this.Trend = value; return this; }
public DashboardSeries getServicesByType() { return ServicesByType; }
public KpiV2Response setServicesByType(DashboardSeries value) { this.ServicesByType = value; return this; }
public ArrayList<KpiV2LocationRow> getLocationLeaderboard() { return LocationLeaderboard; }
public KpiV2Response setLocationLeaderboard(ArrayList<KpiV2LocationRow> value) { this.LocationLeaderboard = value; return this; }
public ArrayList<KpiV2WorkerRow> getWorkerProductivity() { return WorkerProductivity; }
public KpiV2Response setWorkerProductivity(ArrayList<KpiV2WorkerRow> value) { this.WorkerProductivity = value; return this; }
public ArrayList<KpiV2HeatPoint> getHeatmap() { return Heatmap; }
public KpiV2Response setHeatmap(ArrayList<KpiV2HeatPoint> value) { this.Heatmap = value; return this; }
public ArrayList<KpiV2LiveRow> getLiveQueue() { return LiveQueue; }
public KpiV2Response setLiveQueue(ArrayList<KpiV2LiveRow> value) { this.LiveQueue = value; return this; }
}
public static class DashboardStatTile
{
public String Key = null;
public String Label = null;
public Double Value = null;
public Double PreviousValue = null;
public String Unit = null;
public Double DeltaPct = null;
public String getKey() { return Key; }
public DashboardStatTile setKey(String value) { this.Key = value; return this; }
public String getLabel() { return Label; }
public DashboardStatTile setLabel(String value) { this.Label = value; return this; }
public Double getValue() { return Value; }
public DashboardStatTile setValue(Double value) { this.Value = value; return this; }
public Double getPreviousValue() { return PreviousValue; }
public DashboardStatTile setPreviousValue(Double value) { this.PreviousValue = value; return this; }
public String getUnit() { return Unit; }
public DashboardStatTile setUnit(String value) { this.Unit = value; return this; }
public Double getDeltaPct() { return DeltaPct; }
public DashboardStatTile setDeltaPct(Double value) { this.DeltaPct = value; return this; }
}
public static class DashboardSeries
{
public String Name = null;
public ArrayList<DashboardSeriesPoint> Points = new ArrayList<DashboardSeriesPoint>();
public String getName() { return Name; }
public DashboardSeries setName(String value) { this.Name = value; return this; }
public ArrayList<DashboardSeriesPoint> getPoints() { return Points; }
public DashboardSeries setPoints(ArrayList<DashboardSeriesPoint> value) { this.Points = value; return this; }
}
public static class DashboardSeriesPoint
{
public String Label = null;
public Double Value = null;
public String getLabel() { return Label; }
public DashboardSeriesPoint setLabel(String value) { this.Label = value; return this; }
public Double getValue() { return Value; }
public DashboardSeriesPoint setValue(Double value) { this.Value = value; return this; }
}
public static class KpiV2LocationRow
{
public String LocationName = null;
public Integer Walkins = null;
public Integer Completed = null;
public Double AvgServiceMinutes = null;
public Double AbandonmentPct = null;
public String getLocationName() { return LocationName; }
public KpiV2LocationRow setLocationName(String value) { this.LocationName = value; return this; }
public Integer getWalkins() { return Walkins; }
public KpiV2LocationRow setWalkins(Integer value) { this.Walkins = value; return this; }
public Integer getCompleted() { return Completed; }
public KpiV2LocationRow setCompleted(Integer value) { this.Completed = value; return this; }
public Double getAvgServiceMinutes() { return AvgServiceMinutes; }
public KpiV2LocationRow setAvgServiceMinutes(Double value) { this.AvgServiceMinutes = value; return this; }
public Double getAbandonmentPct() { return AbandonmentPct; }
public KpiV2LocationRow setAbandonmentPct(Double value) { this.AbandonmentPct = value; return this; }
}
public static class KpiV2WorkerRow
{
public String WorkerName = null;
public Integer Completed = null;
public Double AvgServiceMinutes = null;
public String getWorkerName() { return WorkerName; }
public KpiV2WorkerRow setWorkerName(String value) { this.WorkerName = value; return this; }
public Integer getCompleted() { return Completed; }
public KpiV2WorkerRow setCompleted(Integer value) { this.Completed = value; return this; }
public Double getAvgServiceMinutes() { return AvgServiceMinutes; }
public KpiV2WorkerRow setAvgServiceMinutes(Double value) { this.AvgServiceMinutes = value; return this; }
}
public static class KpiV2HeatPoint
{
public Integer Dow = null;
public Integer Hr = null;
public Integer Cnt = null;
public Integer getDow() { return Dow; }
public KpiV2HeatPoint setDow(Integer value) { this.Dow = value; return this; }
public Integer getHr() { return Hr; }
public KpiV2HeatPoint setHr(Integer value) { this.Hr = value; return this; }
public Integer getCnt() { return Cnt; }
public KpiV2HeatPoint setCnt(Integer value) { this.Cnt = value; return this; }
}
public static class KpiV2LiveRow
{
public String LocationName = null;
public Integer Waiting = null;
public Integer InProgress = null;
public String getLocationName() { return LocationName; }
public KpiV2LiveRow setLocationName(String value) { this.LocationName = value; return this; }
public Integer getWaiting() { return Waiting; }
public KpiV2LiveRow setWaiting(Integer value) { this.Waiting = value; return this; }
public Integer getInProgress() { return InProgress; }
public KpiV2LiveRow setInProgress(Integer value) { this.InProgress = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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/xml
Content-Type: application/xml
Content-Length: length
<KpiV2Request xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<FromDate>0001-01-01T00:00:00</FromDate>
<LocationIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
</LocationIds>
<ToDate>0001-01-01T00:00:00</ToDate>
</KpiV2Request>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<KpiV2Response xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Heatmap>
<KpiV2HeatPoint>
<Cnt>0</Cnt>
<Dow>0</Dow>
<Hr>0</Hr>
</KpiV2HeatPoint>
</Heatmap>
<LiveQueue>
<KpiV2LiveRow>
<InProgress>0</InProgress>
<LocationName>String</LocationName>
<Waiting>0</Waiting>
</KpiV2LiveRow>
</LiveQueue>
<LocationLeaderboard>
<KpiV2LocationRow>
<AbandonmentPct>0</AbandonmentPct>
<AvgServiceMinutes>0</AvgServiceMinutes>
<Completed>0</Completed>
<LocationName>String</LocationName>
<Walkins>0</Walkins>
</KpiV2LocationRow>
</LocationLeaderboard>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<ServicesByType>
<Name>String</Name>
<Points>
<DashboardSeriesPoint>
<Label>String</Label>
<Value>0</Value>
</DashboardSeriesPoint>
</Points>
</ServicesByType>
<Stats>
<DashboardStatTile>
<Key>String</Key>
<Label>String</Label>
<PreviousValue>0</PreviousValue>
<Unit>String</Unit>
<Value>0</Value>
</DashboardStatTile>
</Stats>
<Trend>
<DashboardSeries>
<Name>String</Name>
<Points>
<DashboardSeriesPoint>
<Label>String</Label>
<Value>0</Value>
</DashboardSeriesPoint>
</Points>
</DashboardSeries>
</Trend>
<WorkerProductivity>
<KpiV2WorkerRow>
<AvgServiceMinutes>0</AvgServiceMinutes>
<Completed>0</Completed>
<WorkerName>String</WorkerName>
</KpiV2WorkerRow>
</WorkerProductivity>
</KpiV2Response>