Trendsic Platform Service

<back to all web services

KpiV2Request

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dashboard/kpiv2
"use strict";
export class DashboardStatTile {
    /** @param {{Key?:string,Label?:string,Value?:number,PreviousValue?:number,Unit?:string,DeltaPct?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Key;
    /** @type {string} */
    Label;
    /** @type {number} */
    Value;
    /** @type {?number} */
    PreviousValue;
    /** @type {string} */
    Unit;
    /** @type {?number} */
    DeltaPct;
}
export class DashboardSeriesPoint {
    /** @param {{Label?:string,Value?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Label;
    /** @type {number} */
    Value;
}
export class DashboardSeries {
    /** @param {{Name?:string,Points?:DashboardSeriesPoint[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Name;
    /** @type {DashboardSeriesPoint[]} */
    Points = [];
}
export class KpiV2LocationRow {
    /** @param {{LocationName?:string,Walkins?:number,Completed?:number,AvgServiceMinutes?:number,AbandonmentPct?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    LocationName;
    /** @type {number} */
    Walkins;
    /** @type {number} */
    Completed;
    /** @type {number} */
    AvgServiceMinutes;
    /** @type {number} */
    AbandonmentPct;
}
export class KpiV2WorkerRow {
    /** @param {{WorkerName?:string,Completed?:number,AvgServiceMinutes?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    WorkerName;
    /** @type {number} */
    Completed;
    /** @type {number} */
    AvgServiceMinutes;
}
export class KpiV2HeatPoint {
    /** @param {{Dow?:number,Hr?:number,Cnt?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    Dow;
    /** @type {number} */
    Hr;
    /** @type {number} */
    Cnt;
}
export class KpiV2LiveRow {
    /** @param {{LocationName?:string,Waiting?:number,InProgress?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    LocationName;
    /** @type {number} */
    Waiting;
    /** @type {number} */
    InProgress;
}
export class SvcNamedTime {
    /** @param {{Id?:string,Name?:string,SignedSec?:number,Served?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Id;
    /** @type {string} */
    Name;
    /** @type {number} */
    SignedSec;
    /** @type {number} */
    Served;
}
export class SvcTint {
    /** @param {{Field?:string,Tone?:string,Reason?:string,Value?:number,Reference?:number,BranchValue?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Field;
    /** @type {string} */
    Tone;
    /** @type {string} */
    Reason;
    /** @type {?number} */
    Value;
    /** @type {?number} */
    Reference;
    /** @type {?number} */
    BranchValue;
}
export class SvcMetrics {
    /** @param {{Checkins?:number,Walkins?:number,Appts?:number,Served?:number,NoShows?:number,ApptNoShows?:number,CancelledAtWindow?:number,Abandoned?:number,Called?:number,CalledUp?:number,AbandonRate?:number,NoShowRate?:number,AvgServiceSec?:number,MedianServiceSec?:number,AvgWaitSec?:number,MaxWaitSec?:number,AvgWalkUpSec?:number,ExpectedServiceSec?:number,SignedSec?:number,ServingSec?:number,PausedSec?:number,IdleSec?:number,UnstaffedSec?:number,Utilization?:number,IdleShare?:number,PausedShare?:number,Sessions?:number,OpenDays?:number,FeesEarned?:number,AvgFee?:number,FeesPerStaffedHour?:number,ExpectedFeesPerStaffedHour?:number,LaborCost?:number,LaborPartial?:boolean,MissingCostEmployeeIds?:string[],MissingCost?:SvcNamedTime[],LaborLocked?:boolean,Contribution?:number,LostFees?:number,LostNoShowFees?:number,Mix?:{ [index:string]: number; },HourlyServed?:number[],HourlyFees?:number[],HourlyCost?:number[],Tints?:SvcTint[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    Checkins;
    /** @type {number} */
    Walkins;
    /** @type {number} */
    Appts;
    /** @type {number} */
    Served;
    /** @type {number} */
    NoShows;
    /** @type {number} */
    ApptNoShows;
    /** @type {number} */
    CancelledAtWindow;
    /** @type {number} */
    Abandoned;
    /** @type {number} */
    Called;
    /** @type {number} */
    CalledUp;
    /** @type {?number} */
    AbandonRate;
    /** @type {?number} */
    NoShowRate;
    /** @type {?number} */
    AvgServiceSec;
    /** @type {?number} */
    MedianServiceSec;
    /** @type {?number} */
    AvgWaitSec;
    /** @type {number} */
    MaxWaitSec;
    /** @type {?number} */
    AvgWalkUpSec;
    /** @type {?number} */
    ExpectedServiceSec;
    /** @type {number} */
    SignedSec;
    /** @type {number} */
    ServingSec;
    /** @type {number} */
    PausedSec;
    /** @type {number} */
    IdleSec;
    /** @type {number} */
    UnstaffedSec;
    /** @type {?number} */
    Utilization;
    /** @type {?number} */
    IdleShare;
    /** @type {?number} */
    PausedShare;
    /** @type {number} */
    Sessions;
    /** @type {number} */
    OpenDays;
    /** @type {?number} */
    FeesEarned;
    /** @type {?number} */
    AvgFee;
    /** @type {?number} */
    FeesPerStaffedHour;
    /** @type {?number} */
    ExpectedFeesPerStaffedHour;
    /** @type {?number} */
    LaborCost;
    /** @type {boolean} */
    LaborPartial;
    /** @type {string[]} */
    MissingCostEmployeeIds = [];
    /** @type {SvcNamedTime[]} */
    MissingCost = [];
    /** @type {boolean} */
    LaborLocked;
    /** @type {?number} */
    Contribution;
    /** @type {?number} */
    LostFees;
    /** @type {?number} */
    LostNoShowFees;
    /** @type {{ [index:string]: number; }} */
    Mix = {};
    /** @type {number[]} */
    HourlyServed = [];
    /** @type {number[]} */
    HourlyFees = [];
    /** @type {number[]} */
    HourlyCost = [];
    /** @type {SvcTint[]} */
    Tints = [];
}
export class SvcBranchRow {
    /** @param {{BranchId?:string,Name?:string,StateCode?:string,ZoneCode?:string,TimeZone?:string,Windows?:number,RecordingSinceUtc?:string,SessionsSinceUtc?:string,Metrics?:SvcMetrics}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    BranchId;
    /** @type {string} */
    Name;
    /** @type {string} */
    StateCode;
    /** @type {string} */
    ZoneCode;
    /** @type {string} */
    TimeZone;
    /** @type {number} */
    Windows;
    /** @type {?string} */
    RecordingSinceUtc;
    /** @type {?string} */
    SessionsSinceUtc;
    /** @type {SvcMetrics} */
    Metrics;
}
export class SvcStateRow {
    /** @param {{StateCode?:string,StateName?:string,Branches?:number,Metrics?:SvcMetrics}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    StateCode;
    /** @type {string} */
    StateName;
    /** @type {number} */
    Branches;
    /** @type {SvcMetrics} */
    Metrics;
}
export class SvcComparison {
    /** @param {{Mode?:string,FromDate?:string,ToDate?:string,CutoffMinute?:number,HasData?:boolean,Metrics?:SvcMetrics}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Mode;
    /** @type {?string} */
    FromDate;
    /** @type {?string} */
    ToDate;
    /** @type {?number} */
    CutoffMinute;
    /** @type {boolean} */
    HasData;
    /** @type {SvcMetrics} */
    Metrics;
}
export class SvcFeeChange {
    /** @param {{LocationId?:string,OnDate?:string,FromFee?:number,ToFee?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    LocationId;
    /** @type {string} */
    OnDate;
    /** @type {number} */
    FromFee;
    /** @type {number} */
    ToFee;
}
export class SvcServiceRow {
    /** @param {{LineId?:string,Name?:string,Completed?:number,AvgServiceSec?:number,BranchAvgServiceSec?:number,FeesEarned?:number,FeeCurrent?:number,FeeMin?:number,FeeMax?:number,FeePerMinute?:number,BranchFeePerMinute?:number,FeeChanges?:SvcFeeChange[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    LineId;
    /** @type {string} */
    Name;
    /** @type {number} */
    Completed;
    /** @type {?number} */
    AvgServiceSec;
    /** @type {?number} */
    BranchAvgServiceSec;
    /** @type {?number} */
    FeesEarned;
    /** @type {?number} */
    FeeCurrent;
    /** @type {?number} */
    FeeMin;
    /** @type {?number} */
    FeeMax;
    /** @type {?number} */
    FeePerMinute;
    /** @type {?number} */
    BranchFeePerMinute;
    /** @type {SvcFeeChange[]} */
    FeeChanges = [];
}
export class SvcHourRow {
    /** @param {{LocalHour?:number,Served?:number,FeesEarned?:number,CostToStaff?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    LocalHour;
    /** @type {number} */
    Served;
    /** @type {?number} */
    FeesEarned;
    /** @type {?number} */
    CostToStaff;
}
export class SvcWorkerRow {
    /** @param {{EmployeeId?:string,BranchId?:string,BranchName?:string,Name?:string,Served?:number,AvgServiceSec?:number,Utilization?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    EmployeeId;
    /** @type {string} */
    BranchId;
    /** @type {string} */
    BranchName;
    /** @type {string} */
    Name;
    /** @type {number} */
    Served;
    /** @type {?number} */
    AvgServiceSec;
    /** @type {?number} */
    Utilization;
}
export class SvcAlert {
    /** @param {{Level?:string,View?:string,Code?:string,StationId?:string,EmployeeId?:string,BranchId?:string,LineId?:string,Name?:string,OtherLineId?:string,OtherName?:string,StationIds?:string[],Values?:{ [index:string]: number; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Level;
    /** @type {string} */
    View;
    /** @type {string} */
    Code;
    /** @type {?string} */
    StationId;
    /** @type {?string} */
    EmployeeId;
    /** @type {?string} */
    BranchId;
    /** @type {?string} */
    LineId;
    /** @type {string} */
    Name;
    /** @type {?string} */
    OtherLineId;
    /** @type {string} */
    OtherName;
    /** @type {string[]} */
    StationIds = [];
    /** @type {{ [index:string]: number; }} */
    Values = {};
}
export class SvcScope {
    /** @param {{StateCode?:string,Branches?:SvcBranchRow[],States?:SvcStateRow[],Total?:SvcMetrics,Comparison?:SvcComparison,FeesByService?:SvcServiceRow[],ByHour?:SvcHourRow[],Workers?:SvcWorkerRow[],MultiZone?:boolean,MultiState?:boolean,RecordingSinceUtc?:string,SessionsSinceUtc?:string,Alerts?:SvcAlert[],CanSeeStaff?:boolean,CanSeeFinancial?:boolean,CanSeePay?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    StateCode;
    /** @type {SvcBranchRow[]} */
    Branches = [];
    /** @type {SvcStateRow[]} */
    States = [];
    /** @type {SvcMetrics} */
    Total;
    /** @type {SvcComparison} */
    Comparison;
    /** @type {SvcServiceRow[]} */
    FeesByService = [];
    /** @type {SvcHourRow[]} */
    ByHour = [];
    /** @type {SvcWorkerRow[]} */
    Workers = [];
    /** @type {boolean} */
    MultiZone;
    /** @type {boolean} */
    MultiState;
    /** @type {?string} */
    RecordingSinceUtc;
    /** @type {?string} */
    SessionsSinceUtc;
    /** @type {SvcAlert[]} */
    Alerts = [];
    /** @type {boolean} */
    CanSeeStaff;
    /** @type {boolean} */
    CanSeeFinancial;
    /** @type {boolean} */
    CanSeePay;
}
export class KpiV2Response {
    /** @param {{ResponseStatus?:ResponseStatus,Stats?:DashboardStatTile[],Trend?:DashboardSeries[],ServicesByType?:DashboardSeries,LocationLeaderboard?:KpiV2LocationRow[],WorkerProductivity?:KpiV2WorkerRow[],Heatmap?:KpiV2HeatPoint[],LiveQueue?:KpiV2LiveRow[],Scope?:SvcScope}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {ResponseStatus} */
    ResponseStatus;
    /** @type {DashboardStatTile[]} */
    Stats = [];
    /** @type {DashboardSeries[]} */
    Trend = [];
    /** @type {DashboardSeries} */
    ServicesByType;
    /** @type {KpiV2LocationRow[]} */
    LocationLeaderboard = [];
    /** @type {KpiV2WorkerRow[]} */
    WorkerProductivity = [];
    /** @type {KpiV2HeatPoint[]} */
    Heatmap = [];
    /** @type {KpiV2LiveRow[]} */
    LiveQueue = [];
    /** @type {SvcScope} */
    Scope;
}
export class KpiV2Request {
    /** @param {{FromDate?:string,ToDate?:string,LocationIds?:string[],IncludeScope?:boolean,StateCode?:string,Compare?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    FromDate;
    /** @type {string} */
    ToDate;
    /** @type {string[]} */
    LocationIds = [];
    /** @type {boolean} */
    IncludeScope;
    /** @type {string} */
    StateCode;
    /** @type {string} */
    Compare;
}

JavaScript KpiV2Request DTOs

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

HTTP + OTHER

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: 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"],"IncludeScope":false,"StateCode":"String","Compare":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
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}}