Trendsic Platform Service

<back to all web services

KpiV2Request

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dashboard/kpiv2

export class DashboardStatTile
{
    public Key: string;
    public Label: string;
    public Value: number;
    public PreviousValue?: number;
    public Unit: string;
    public DeltaPct?: number;

    public constructor(init?: Partial<DashboardStatTile>) { (Object as any).assign(this, init); }
}

export class DashboardSeriesPoint
{
    public Label: string;
    public Value: number;

    public constructor(init?: Partial<DashboardSeriesPoint>) { (Object as any).assign(this, init); }
}

export class DashboardSeries
{
    public Name: string;
    public Points: DashboardSeriesPoint[] = [];

    public constructor(init?: Partial<DashboardSeries>) { (Object as any).assign(this, init); }
}

export class KpiV2LocationRow
{
    public LocationName: string;
    public Walkins: number;
    public Completed: number;
    public AvgServiceMinutes: number;
    public AbandonmentPct: number;

    public constructor(init?: Partial<KpiV2LocationRow>) { (Object as any).assign(this, init); }
}

export class KpiV2WorkerRow
{
    public WorkerName: string;
    public Completed: number;
    public AvgServiceMinutes: number;

    public constructor(init?: Partial<KpiV2WorkerRow>) { (Object as any).assign(this, init); }
}

export class KpiV2HeatPoint
{
    public Dow: number;
    public Hr: number;
    public Cnt: number;

    public constructor(init?: Partial<KpiV2HeatPoint>) { (Object as any).assign(this, init); }
}

export class KpiV2LiveRow
{
    public LocationName: string;
    public Waiting: number;
    public InProgress: number;

    public constructor(init?: Partial<KpiV2LiveRow>) { (Object as any).assign(this, init); }
}

export class SvcNamedTime
{
    public Id: string;
    public Name: string;
    public SignedSec: number;
    public Served: number;

    public constructor(init?: Partial<SvcNamedTime>) { (Object as any).assign(this, init); }
}

export class SvcTint
{
    public Field: string;
    public Tone: string;
    public Reason: string;
    public Value?: number;
    public Reference?: number;
    public BranchValue?: number;

    public constructor(init?: Partial<SvcTint>) { (Object as any).assign(this, init); }
}

export class SvcMetrics
{
    public Checkins: number;
    public Walkins: number;
    public Appts: number;
    public Served: number;
    public NoShows: number;
    public ApptNoShows: number;
    public CancelledAtWindow: number;
    public Abandoned: number;
    public Called: number;
    public CalledUp: number;
    public AbandonRate?: number;
    public NoShowRate?: number;
    public AvgServiceSec?: number;
    public MedianServiceSec?: number;
    public AvgWaitSec?: number;
    public MaxWaitSec: number;
    public AvgWalkUpSec?: number;
    public ExpectedServiceSec?: number;
    public SignedSec: number;
    public ServingSec: number;
    public PausedSec: number;
    public IdleSec: number;
    public UnstaffedSec: number;
    public Utilization?: number;
    public IdleShare?: number;
    public PausedShare?: number;
    public Sessions: number;
    public OpenDays: number;
    public FeesEarned?: number;
    public AvgFee?: number;
    public FeesPerStaffedHour?: number;
    public ExpectedFeesPerStaffedHour?: number;
    public LaborCost?: number;
    public LaborPartial: boolean;
    public MissingCostEmployeeIds: string[] = [];
    public MissingCost: SvcNamedTime[] = [];
    public LaborLocked: boolean;
    public Contribution?: number;
    public LostFees?: number;
    public LostNoShowFees?: number;
    public Mix: { [index:string]: number; } = {};
    public HourlyServed: number[] = [];
    public HourlyFees: number[] = [];
    public HourlyCost: number[] = [];
    public Tints: SvcTint[] = [];

    public constructor(init?: Partial<SvcMetrics>) { (Object as any).assign(this, init); }
}

export class SvcBranchRow
{
    public BranchId: string;
    public Name: string;
    public StateCode: string;
    public ZoneCode: string;
    public TimeZone: string;
    public Windows: number;
    public RecordingSinceUtc?: string;
    public SessionsSinceUtc?: string;
    public Metrics: SvcMetrics;

    public constructor(init?: Partial<SvcBranchRow>) { (Object as any).assign(this, init); }
}

export class SvcStateRow
{
    public StateCode: string;
    public StateName: string;
    public Branches: number;
    public Metrics: SvcMetrics;

    public constructor(init?: Partial<SvcStateRow>) { (Object as any).assign(this, init); }
}

export class SvcComparison
{
    public Mode: string;
    public FromDate?: string;
    public ToDate?: string;
    public CutoffMinute?: number;
    public HasData: boolean;
    public Metrics: SvcMetrics;

    public constructor(init?: Partial<SvcComparison>) { (Object as any).assign(this, init); }
}

export class SvcFeeChange
{
    public LocationId: string;
    public OnDate: string;
    public FromFee: number;
    public ToFee: number;

    public constructor(init?: Partial<SvcFeeChange>) { (Object as any).assign(this, init); }
}

export class SvcServiceRow
{
    public LineId: string;
    public Name: string;
    public Completed: number;
    public AvgServiceSec?: number;
    public BranchAvgServiceSec?: number;
    public FeesEarned?: number;
    public FeeCurrent?: number;
    public FeeMin?: number;
    public FeeMax?: number;
    public FeePerMinute?: number;
    public BranchFeePerMinute?: number;
    public FeeChanges: SvcFeeChange[] = [];

    public constructor(init?: Partial<SvcServiceRow>) { (Object as any).assign(this, init); }
}

export class SvcHourRow
{
    public LocalHour: number;
    public Served: number;
    public FeesEarned?: number;
    public CostToStaff?: number;

    public constructor(init?: Partial<SvcHourRow>) { (Object as any).assign(this, init); }
}

export class SvcWorkerRow
{
    public EmployeeId: string;
    public BranchId: string;
    public BranchName: string;
    public Name: string;
    public Served: number;
    public AvgServiceSec?: number;
    public Utilization?: number;

    public constructor(init?: Partial<SvcWorkerRow>) { (Object as any).assign(this, init); }
}

export class SvcAlert
{
    public Level: string;
    public View: string;
    public Code: string;
    public StationId?: string;
    public EmployeeId?: string;
    public BranchId?: string;
    public LineId?: string;
    public Name: string;
    public OtherLineId?: string;
    public OtherName: string;
    public StationIds: string[] = [];
    public Values: { [index:string]: number; } = {};

    public constructor(init?: Partial<SvcAlert>) { (Object as any).assign(this, init); }
}

export class SvcScope
{
    public StateCode: string;
    public Branches: SvcBranchRow[] = [];
    public States: SvcStateRow[] = [];
    public Total: SvcMetrics;
    public Comparison: SvcComparison;
    public FeesByService: SvcServiceRow[] = [];
    public ByHour: SvcHourRow[] = [];
    public Workers: SvcWorkerRow[] = [];
    public MultiZone: boolean;
    public MultiState: boolean;
    public RecordingSinceUtc?: string;
    public SessionsSinceUtc?: string;
    public Alerts: SvcAlert[] = [];
    public CanSeeStaff: boolean;
    public CanSeeFinancial: boolean;
    public CanSeePay: boolean;

    public constructor(init?: Partial<SvcScope>) { (Object as any).assign(this, init); }
}

export class KpiV2Response
{
    public ResponseStatus: ResponseStatus;
    public Stats: DashboardStatTile[] = [];
    public Trend: DashboardSeries[] = [];
    public ServicesByType: DashboardSeries;
    public LocationLeaderboard: KpiV2LocationRow[] = [];
    public WorkerProductivity: KpiV2WorkerRow[] = [];
    public Heatmap: KpiV2HeatPoint[] = [];
    public LiveQueue: KpiV2LiveRow[] = [];
    public Scope: SvcScope;

    public constructor(init?: Partial<KpiV2Response>) { (Object as any).assign(this, init); }
}

export class KpiV2Request
{
    public FromDate: string;
    public ToDate: string;
    public LocationIds: string[] = [];
    public IncludeScope: boolean;
    public StateCode: string;
    public Compare: string;

    public constructor(init?: Partial<KpiV2Request>) { (Object as any).assign(this, init); }
}

TypeScript KpiV2Request DTOs

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

HTTP + JSON

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"],"IncludeScope":false,"StateCode":"String","Compare":"String"}
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}],"Scope":{"StateCode":"String","Branches":[{"BranchId":"00000000000000000000000000000000","Name":"String","StateCode":"String","ZoneCode":"String","TimeZone":"String","Windows":0,"RecordingSinceUtc":"0001-01-01T00:00:00.0000000","SessionsSinceUtc":"0001-01-01T00:00:00.0000000","Metrics":{"Checkins":0,"Walkins":0,"Appts":0,"Served":0,"NoShows":0,"ApptNoShows":0,"CancelledAtWindow":0,"Abandoned":0,"Called":0,"CalledUp":0,"AbandonRate":0,"NoShowRate":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"MaxWaitSec":0,"AvgWalkUpSec":0,"ExpectedServiceSec":0,"SignedSec":0,"ServingSec":0,"PausedSec":0,"IdleSec":0,"UnstaffedSec":0,"Utilization":0,"IdleShare":0,"PausedShare":0,"Sessions":0,"OpenDays":0,"FeesEarned":0,"AvgFee":0,"FeesPerStaffedHour":0,"ExpectedFeesPerStaffedHour":0,"LaborCost":0,"LaborPartial":false,"MissingCostEmployeeIds":["00000000000000000000000000000000"],"MissingCost":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"LaborLocked":false,"Contribution":0,"LostFees":0,"LostNoShowFees":0,"Mix":{"00000000000000000000000000000000":0},"HourlyServed":[0],"HourlyFees":[0],"HourlyCost":[0],"Tints":[{"Field":"String","Tone":"String","Reason":"String","Value":0,"Reference":0,"BranchValue":0}]}}],"States":[{"StateCode":"String","StateName":"String","Branches":0,"Metrics":{"Checkins":0,"Walkins":0,"Appts":0,"Served":0,"NoShows":0,"ApptNoShows":0,"CancelledAtWindow":0,"Abandoned":0,"Called":0,"CalledUp":0,"AbandonRate":0,"NoShowRate":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"MaxWaitSec":0,"AvgWalkUpSec":0,"ExpectedServiceSec":0,"SignedSec":0,"ServingSec":0,"PausedSec":0,"IdleSec":0,"UnstaffedSec":0,"Utilization":0,"IdleShare":0,"PausedShare":0,"Sessions":0,"OpenDays":0,"FeesEarned":0,"AvgFee":0,"FeesPerStaffedHour":0,"ExpectedFeesPerStaffedHour":0,"LaborCost":0,"LaborPartial":false,"MissingCostEmployeeIds":["00000000000000000000000000000000"],"MissingCost":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"LaborLocked":false,"Contribution":0,"LostFees":0,"LostNoShowFees":0,"Mix":{"00000000000000000000000000000000":0},"HourlyServed":[0],"HourlyFees":[0],"HourlyCost":[0],"Tints":[{"Field":"String","Tone":"String","Reason":"String","Value":0,"Reference":0,"BranchValue":0}]}}],"Total":{"Checkins":0,"Walkins":0,"Appts":0,"Served":0,"NoShows":0,"ApptNoShows":0,"CancelledAtWindow":0,"Abandoned":0,"Called":0,"CalledUp":0,"AbandonRate":0,"NoShowRate":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"MaxWaitSec":0,"AvgWalkUpSec":0,"ExpectedServiceSec":0,"SignedSec":0,"ServingSec":0,"PausedSec":0,"IdleSec":0,"UnstaffedSec":0,"Utilization":0,"IdleShare":0,"PausedShare":0,"Sessions":0,"OpenDays":0,"FeesEarned":0,"AvgFee":0,"FeesPerStaffedHour":0,"ExpectedFeesPerStaffedHour":0,"LaborCost":0,"LaborPartial":false,"MissingCostEmployeeIds":["00000000000000000000000000000000"],"MissingCost":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"LaborLocked":false,"Contribution":0,"LostFees":0,"LostNoShowFees":0,"Mix":{"00000000000000000000000000000000":0},"HourlyServed":[0],"HourlyFees":[0],"HourlyCost":[0],"Tints":[{"Field":"String","Tone":"String","Reason":"String","Value":0,"Reference":0,"BranchValue":0}]},"Comparison":{"Mode":"String","FromDate":"0001-01-01T00:00:00.0000000","ToDate":"0001-01-01T00:00:00.0000000","CutoffMinute":0,"HasData":false,"Metrics":{"Checkins":0,"Walkins":0,"Appts":0,"Served":0,"NoShows":0,"ApptNoShows":0,"CancelledAtWindow":0,"Abandoned":0,"Called":0,"CalledUp":0,"AbandonRate":0,"NoShowRate":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"MaxWaitSec":0,"AvgWalkUpSec":0,"ExpectedServiceSec":0,"SignedSec":0,"ServingSec":0,"PausedSec":0,"IdleSec":0,"UnstaffedSec":0,"Utilization":0,"IdleShare":0,"PausedShare":0,"Sessions":0,"OpenDays":0,"FeesEarned":0,"AvgFee":0,"FeesPerStaffedHour":0,"ExpectedFeesPerStaffedHour":0,"LaborCost":0,"LaborPartial":false,"MissingCostEmployeeIds":["00000000000000000000000000000000"],"MissingCost":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"LaborLocked":false,"Contribution":0,"LostFees":0,"LostNoShowFees":0,"Mix":{"00000000000000000000000000000000":0},"HourlyServed":[0],"HourlyFees":[0],"HourlyCost":[0],"Tints":[{"Field":"String","Tone":"String","Reason":"String","Value":0,"Reference":0,"BranchValue":0}]}},"FeesByService":[{"LineId":"00000000000000000000000000000000","Name":"String","Completed":0,"AvgServiceSec":0,"BranchAvgServiceSec":0,"FeesEarned":0,"FeeCurrent":0,"FeeMin":0,"FeeMax":0,"FeePerMinute":0,"BranchFeePerMinute":0,"FeeChanges":[{"LocationId":"00000000000000000000000000000000","OnDate":"0001-01-01T00:00:00.0000000","FromFee":0,"ToFee":0}]}],"ByHour":[{"LocalHour":0,"Served":0,"FeesEarned":0,"CostToStaff":0}],"Workers":[{"EmployeeId":"00000000000000000000000000000000","BranchId":"00000000000000000000000000000000","BranchName":"String","Name":"String","Served":0,"AvgServiceSec":0,"Utilization":0}],"MultiZone":false,"MultiState":false,"RecordingSinceUtc":"0001-01-01T00:00:00.0000000","SessionsSinceUtc":"0001-01-01T00:00:00.0000000","Alerts":[{"Level":"String","View":"String","Code":"String","StationId":"00000000000000000000000000000000","EmployeeId":"00000000000000000000000000000000","BranchId":"00000000000000000000000000000000","LineId":"00000000000000000000000000000000","Name":"String","OtherLineId":"00000000000000000000000000000000","OtherName":"String","StationIds":["00000000000000000000000000000000"],"Values":{"String":0}}],"CanSeeStaff":false,"CanSeeFinancial":false,"CanSeePay":false}}