Trendsic Platform Service

<back to all web services

KpiV2VisitsRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dashboard/kpiv2/visits
import Foundation
import ServiceStack

public class KpiV2VisitsRequest : Codable
{
    public var branchId:String
    public var fromDate:Date
    public var toDate:Date
    public var stationId:String?
    public var employeeId:String?
    public var outcome:String
    public var lineId:String?
    public var page:Int
    public var pageSize:Int

    required public init(){}
}

public class KpiV2VisitsResponse : Codable
{
    public var responseStatus:ResponseStatus
    public var visits:SvcVisitPage

    required public init(){}
}

public class SvcVisitPage : Codable
{
    public var rows:[SvcVisitRow] = []
    public var totalRows:Int
    public var page:Int
    public var pageSize:Int
    public var outcomeCounts:[String:Int] = [:]
    public var services:[SvcChip] = []
    public var canSeeStaff:Bool
    public var canSeeFinancial:Bool

    required public init(){}
}

public class SvcVisitRow : Codable
{
    public var checkinId:String
    public var ticketLabel:String
    public var localDate:Date
    public var lineId:String
    public var serviceName:String
    public var stationId:String?
    public var stationName:String
    public var employeeId:String?
    public var employeeName:String
    public var customerName:String
    public var contactId:Int?
    public var contactAgentId:Int?
    public var customerId:String
    public var isAppointment:Bool
    public var localHere:Date?
    public var localCalled:Date?
    public var localStart:Date?
    public var localEnd:Date?
    public var waitSec:Int?
    public var serveSec:Int?
    public var outcome:String
    public var fee:Double?

    required public init(){}
}

public class SvcChip : Codable
{
    public var lineId:String
    public var name:String
    public var n:Int

    required public init(){}
}


Swift KpiV2VisitsRequest 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/visits HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	BranchId: 00000000000000000000000000000000,
	FromDate: 0001-01-01,
	ToDate: 0001-01-01,
	StationId: 00000000000000000000000000000000,
	EmployeeId: 00000000000000000000000000000000,
	Outcome: String,
	LineId: 00000000000000000000000000000000,
	Page: 0,
	PageSize: 0
}
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
		}
	},
	Visits: 
	{
		Rows: 
		[
			{
				CheckinId: 00000000000000000000000000000000,
				TicketLabel: String,
				LocalDate: 0001-01-01,
				LineId: 00000000000000000000000000000000,
				ServiceName: String,
				StationId: 00000000000000000000000000000000,
				StationName: String,
				EmployeeId: 00000000000000000000000000000000,
				EmployeeName: String,
				CustomerName: String,
				ContactId: 0,
				ContactAgentId: 0,
				CustomerId: 00000000000000000000000000000000,
				IsAppointment: False,
				LocalHere: 0001-01-01,
				LocalCalled: 0001-01-01,
				LocalStart: 0001-01-01,
				LocalEnd: 0001-01-01,
				WaitSec: 0,
				ServeSec: 0,
				Outcome: String,
				Fee: 0
			}
		],
		TotalRows: 0,
		Page: 0,
		PageSize: 0,
		OutcomeCounts: 
		{
			String: 0
		},
		Services: 
		[
			{
				LineId: 00000000000000000000000000000000,
				Name: String,
				N: 0
			}
		],
		CanSeeStaff: False,
		CanSeeFinancial: False
	}
}