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)
        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)
        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
    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
	]
}
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
		}
	]
}