Trendsic Platform Service

<back to all web services

KpiV2Request

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dashboard/kpiv2
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using CRM.AgencyPlatform.API.Internal;

namespace CRM.AgencyPlatform.API.Internal
{
    public partial class DashboardSeries
    {
        public virtual string Name { get; set; }
        public virtual List<DashboardSeriesPoint> Points { get; set; } = [];
    }

    public partial class DashboardSeriesPoint
    {
        public virtual string Label { get; set; }
        public virtual double Value { get; set; }
    }

    public partial class DashboardStatTile
    {
        public virtual string Key { get; set; }
        public virtual string Label { get; set; }
        public virtual double Value { get; set; }
        public virtual double? PreviousValue { get; set; }
        public virtual string Unit { get; set; }
        public virtual double? DeltaPct { get; set; }
    }

    public partial class KpiV2HeatPoint
    {
        public virtual int Dow { get; set; }
        public virtual int Hr { get; set; }
        public virtual int Cnt { get; set; }
    }

    public partial class KpiV2LiveRow
    {
        public virtual string LocationName { get; set; }
        public virtual int Waiting { get; set; }
        public virtual int InProgress { get; set; }
    }

    public partial class KpiV2LocationRow
    {
        public virtual string LocationName { get; set; }
        public virtual int Walkins { get; set; }
        public virtual int Completed { get; set; }
        public virtual double AvgServiceMinutes { get; set; }
        public virtual double AbandonmentPct { get; set; }
    }

    public partial class KpiV2Request
    {
        public virtual DateTime FromDate { get; set; }
        public virtual DateTime ToDate { get; set; }
        public virtual List<Guid> LocationIds { get; set; } = [];
    }

    public partial class KpiV2Response
    {
        public virtual ResponseStatus ResponseStatus { get; set; }
        public virtual List<DashboardStatTile> Stats { get; set; } = [];
        public virtual List<DashboardSeries> Trend { get; set; } = [];
        public virtual DashboardSeries ServicesByType { get; set; }
        public virtual List<KpiV2LocationRow> LocationLeaderboard { get; set; } = [];
        public virtual List<KpiV2WorkerRow> WorkerProductivity { get; set; } = [];
        public virtual List<KpiV2HeatPoint> Heatmap { get; set; } = [];
        public virtual List<KpiV2LiveRow> LiveQueue { get; set; } = [];
    }

    public partial class KpiV2WorkerRow
    {
        public virtual string WorkerName { get; set; }
        public virtual int Completed { get; set; }
        public virtual double AvgServiceMinutes { get; set; }
    }

}

C# 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
		}
	]
}