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 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 constructor(init?: Partial<KpiV2Response>) { (Object as any).assign(this, init); }
}

export class KpiV2Request
{
    public FromDate: string;
    public ToDate: string;
    public LocationIds: 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 .jsv suffix or ?format=jsv

HTTP + JSV

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/jsv
Content-Type: text/jsv
Content-Length: length

{
	FromDate: 0001-01-01,
	ToDate: 0001-01-01,
	LocationIds: 
	[
		00000000000000000000000000000000
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
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
		}
	],
	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
		}
	]
}