Trendsic Platform Service

<back to all web services

KpiV2Request

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

Namespace Global

    Namespace CRM.AgencyPlatform.API.Internal

        Public Partial Class DashboardSeries
            Public Overridable Property Name As String
            Public Overridable Property Points As List(Of DashboardSeriesPoint) = New List(Of DashboardSeriesPoint)
        End Class

        Public Partial Class DashboardSeriesPoint
            Public Overridable Property Label As String
            Public Overridable Property Value As Double
        End Class

        Public Partial Class DashboardStatTile
            Public Overridable Property Key As String
            Public Overridable Property Label As String
            Public Overridable Property Value As Double
            Public Overridable Property PreviousValue As Double?
            Public Overridable Property Unit As String
            Public Overridable Property DeltaPct As Double?
        End Class

        Public Partial Class KpiV2HeatPoint
            Public Overridable Property Dow As Integer
            Public Overridable Property Hr As Integer
            Public Overridable Property Cnt As Integer
        End Class

        Public Partial Class KpiV2LiveRow
            Public Overridable Property LocationName As String
            Public Overridable Property Waiting As Integer
            Public Overridable Property InProgress As Integer
        End Class

        Public Partial Class KpiV2LocationRow
            Public Overridable Property LocationName As String
            Public Overridable Property Walkins As Integer
            Public Overridable Property Completed As Integer
            Public Overridable Property AvgServiceMinutes As Double
            Public Overridable Property AbandonmentPct As Double
        End Class

        Public Partial Class KpiV2Request
            Public Overridable Property FromDate As Date
            Public Overridable Property ToDate As Date
            Public Overridable Property LocationIds As List(Of Guid) = New List(Of Guid)
            Public Overridable Property IncludeScope As Boolean
            Public Overridable Property StateCode As String
            Public Overridable Property Compare As String
        End Class

        Public Partial Class KpiV2Response
            Public Overridable Property ResponseStatus As ResponseStatus
            Public Overridable Property Stats As List(Of DashboardStatTile) = New List(Of DashboardStatTile)
            Public Overridable Property Trend As List(Of DashboardSeries) = New List(Of DashboardSeries)
            Public Overridable Property ServicesByType As DashboardSeries
            Public Overridable Property LocationLeaderboard As List(Of KpiV2LocationRow) = New List(Of KpiV2LocationRow)
            Public Overridable Property WorkerProductivity As List(Of KpiV2WorkerRow) = New List(Of KpiV2WorkerRow)
            Public Overridable Property Heatmap As List(Of KpiV2HeatPoint) = New List(Of KpiV2HeatPoint)
            Public Overridable Property LiveQueue As List(Of KpiV2LiveRow) = New List(Of KpiV2LiveRow)
            Public Overridable Property Scope As SvcScope
        End Class

        Public Partial Class KpiV2WorkerRow
            Public Overridable Property WorkerName As String
            Public Overridable Property Completed As Integer
            Public Overridable Property AvgServiceMinutes As Double
        End Class

        Public Partial Class SvcAlert
            Public Overridable Property Level As String
            Public Overridable Property View As String
            Public Overridable Property Code As String
            Public Overridable Property StationId As Guid?
            Public Overridable Property EmployeeId As Guid?
            Public Overridable Property BranchId As Guid?
            Public Overridable Property LineId As Guid?
            Public Overridable Property Name As String
            Public Overridable Property OtherLineId As Guid?
            Public Overridable Property OtherName As String
            Public Overridable Property StationIds As List(Of Guid) = New List(Of Guid)
            Public Overridable Property Values As Dictionary(Of String, Double) = New Dictionary(Of String, Double)
        End Class

        Public Partial Class SvcBranchRow
            Public Overridable Property BranchId As Guid
            Public Overridable Property Name As String
            Public Overridable Property StateCode As String
            Public Overridable Property ZoneCode As String
            Public Overridable Property TimeZone As String
            Public Overridable Property Windows As Integer
            Public Overridable Property RecordingSinceUtc As Date?
            Public Overridable Property SessionsSinceUtc As Date?
            Public Overridable Property Metrics As SvcMetrics
        End Class

        Public Partial Class SvcComparison
            Public Overridable Property Mode As String
            Public Overridable Property FromDate As Date?
            Public Overridable Property ToDate As Date?
            Public Overridable Property CutoffMinute As Integer?
            Public Overridable Property HasData As Boolean
            Public Overridable Property Metrics As SvcMetrics
        End Class

        Public Partial Class SvcFeeChange
            Public Overridable Property LocationId As Guid
            Public Overridable Property OnDate As Date
            Public Overridable Property FromFee As Decimal
            Public Overridable Property ToFee As Decimal
        End Class

        Public Partial Class SvcHourRow
            Public Overridable Property LocalHour As Integer
            Public Overridable Property Served As Integer
            Public Overridable Property FeesEarned As Decimal?
            Public Overridable Property CostToStaff As Decimal?
        End Class

        Public Partial Class SvcMetrics
            Public Overridable Property Checkins As Integer
            Public Overridable Property Walkins As Integer
            Public Overridable Property Appts As Integer
            Public Overridable Property Served As Integer
            Public Overridable Property NoShows As Integer
            Public Overridable Property ApptNoShows As Integer
            Public Overridable Property CancelledAtWindow As Integer
            Public Overridable Property Abandoned As Integer
            Public Overridable Property Called As Integer
            Public Overridable Property CalledUp As Integer
            Public Overridable Property AbandonRate As Double?
            Public Overridable Property NoShowRate As Double?
            Public Overridable Property AvgServiceSec As Double?
            Public Overridable Property MedianServiceSec As Double?
            Public Overridable Property AvgWaitSec As Double?
            Public Overridable Property MaxWaitSec As Integer
            Public Overridable Property AvgWalkUpSec As Double?
            Public Overridable Property ExpectedServiceSec As Double?
            Public Overridable Property SignedSec As Long
            Public Overridable Property ServingSec As Long
            Public Overridable Property PausedSec As Long
            Public Overridable Property IdleSec As Long
            Public Overridable Property UnstaffedSec As Long
            Public Overridable Property Utilization As Double?
            Public Overridable Property IdleShare As Double?
            Public Overridable Property PausedShare As Double?
            Public Overridable Property Sessions As Integer
            Public Overridable Property OpenDays As Integer
            Public Overridable Property FeesEarned As Decimal?
            Public Overridable Property AvgFee As Decimal?
            Public Overridable Property FeesPerStaffedHour As Decimal?
            Public Overridable Property ExpectedFeesPerStaffedHour As Decimal?
            Public Overridable Property LaborCost As Decimal?
            Public Overridable Property LaborPartial As Boolean
            Public Overridable Property MissingCostEmployeeIds As List(Of Guid) = New List(Of Guid)
            Public Overridable Property MissingCost As List(Of SvcNamedTime) = New List(Of SvcNamedTime)
            Public Overridable Property LaborLocked As Boolean
            Public Overridable Property Contribution As Decimal?
            Public Overridable Property LostFees As Decimal?
            Public Overridable Property LostNoShowFees As Decimal?
            Public Overridable Property Mix As Dictionary(Of Guid, Integer) = New Dictionary(Of Guid, Integer)
            Public Overridable Property HourlyServed As Integer() = New Integer(){}
            Public Overridable Property HourlyFees As Decimal() = New Decimal(){}
            Public Overridable Property HourlyCost As Decimal() = New Decimal(){}
            Public Overridable Property Tints As List(Of SvcTint) = New List(Of SvcTint)
        End Class

        Public Partial Class SvcNamedTime
            Public Overridable Property Id As Guid
            Public Overridable Property Name As String
            Public Overridable Property SignedSec As Long
            Public Overridable Property Served As Integer
        End Class

        Public Partial Class SvcScope
            Public Overridable Property StateCode As String
            Public Overridable Property Branches As List(Of SvcBranchRow) = New List(Of SvcBranchRow)
            Public Overridable Property States As List(Of SvcStateRow) = New List(Of SvcStateRow)
            Public Overridable Property Total As SvcMetrics
            Public Overridable Property Comparison As SvcComparison
            Public Overridable Property FeesByService As List(Of SvcServiceRow) = New List(Of SvcServiceRow)
            Public Overridable Property ByHour As List(Of SvcHourRow) = New List(Of SvcHourRow)
            Public Overridable Property Workers As List(Of SvcWorkerRow) = New List(Of SvcWorkerRow)
            Public Overridable Property MultiZone As Boolean
            Public Overridable Property MultiState As Boolean
            Public Overridable Property RecordingSinceUtc As Date?
            Public Overridable Property SessionsSinceUtc As Date?
            Public Overridable Property Alerts As List(Of SvcAlert) = New List(Of SvcAlert)
            Public Overridable Property CanSeeStaff As Boolean
            Public Overridable Property CanSeeFinancial As Boolean
            Public Overridable Property CanSeePay As Boolean
        End Class

        Public Partial Class SvcServiceRow
            Public Overridable Property LineId As Guid
            Public Overridable Property Name As String
            Public Overridable Property Completed As Integer
            Public Overridable Property AvgServiceSec As Double?
            Public Overridable Property BranchAvgServiceSec As Double?
            Public Overridable Property FeesEarned As Decimal?
            Public Overridable Property FeeCurrent As Decimal?
            Public Overridable Property FeeMin As Decimal?
            Public Overridable Property FeeMax As Decimal?
            Public Overridable Property FeePerMinute As Decimal?
            Public Overridable Property BranchFeePerMinute As Decimal?
            Public Overridable Property FeeChanges As List(Of SvcFeeChange) = New List(Of SvcFeeChange)
        End Class

        Public Partial Class SvcStateRow
            Public Overridable Property StateCode As String
            Public Overridable Property StateName As String
            Public Overridable Property Branches As Integer
            Public Overridable Property Metrics As SvcMetrics
        End Class

        Public Partial Class SvcTint
            Public Overridable Property Field As String
            Public Overridable Property Tone As String
            Public Overridable Property Reason As String
            Public Overridable Property Value As Double?
            Public Overridable Property Reference As Double?
            Public Overridable Property BranchValue As Double?
        End Class

        Public Partial Class SvcWorkerRow
            Public Overridable Property EmployeeId As Guid
            Public Overridable Property BranchId As Guid
            Public Overridable Property BranchName As String
            Public Overridable Property Name As String
            Public Overridable Property Served As Integer
            Public Overridable Property AvgServiceSec As Double?
            Public Overridable Property Utilization As Double?
        End Class
    End Namespace
End Namespace

VB.NET 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
	],
	IncludeScope: False,
	StateCode: String,
	Compare: String
}
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
		}
	],
	Scope: 
	{
		StateCode: String,
		Branches: 
		[
			{
				BranchId: 00000000000000000000000000000000,
				Name: String,
				StateCode: String,
				ZoneCode: String,
				TimeZone: String,
				Windows: 0,
				RecordingSinceUtc: 0001-01-01,
				SessionsSinceUtc: 0001-01-01,
				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-01,
			ToDate: 0001-01-01,
			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-01,
						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-01,
		SessionsSinceUtc: 0001-01-01,
		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
	}
}