Trendsic Platform Service

<back to all web services

KpiV2LiveRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/dashboard/kpiv2/live/{BranchId}
import 'package:servicestack/servicestack.dart';

class SvcLiveWindow implements IConvertible
{
    String? StationId;
    String? Name;
    String? Status;
    String? EmployeeId;
    String? EmployeeName;
    DateTime? SignedInUtc;
    DateTime? LastSeenUtc;
    DateTime? SinceUtc;
    String? PauseReason;
    String? CheckinId;
    String? TicketLabel;
    String? CustomerName;
    String? ServiceName;
    DateTime? StartUtc;
    DateTime? CalledUtc;
    int? ServedToday;
    DateTime? LastCalledUtc;

    SvcLiveWindow({this.StationId,this.Name,this.Status,this.EmployeeId,this.EmployeeName,this.SignedInUtc,this.LastSeenUtc,this.SinceUtc,this.PauseReason,this.CheckinId,this.TicketLabel,this.CustomerName,this.ServiceName,this.StartUtc,this.CalledUtc,this.ServedToday,this.LastCalledUtc});
    SvcLiveWindow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        StationId = json['StationId'];
        Name = json['Name'];
        Status = json['Status'];
        EmployeeId = json['EmployeeId'];
        EmployeeName = json['EmployeeName'];
        SignedInUtc = JsonConverters.fromJson(json['SignedInUtc'],'DateTime',context!);
        LastSeenUtc = JsonConverters.fromJson(json['LastSeenUtc'],'DateTime',context!);
        SinceUtc = JsonConverters.fromJson(json['SinceUtc'],'DateTime',context!);
        PauseReason = json['PauseReason'];
        CheckinId = json['CheckinId'];
        TicketLabel = json['TicketLabel'];
        CustomerName = json['CustomerName'];
        ServiceName = json['ServiceName'];
        StartUtc = JsonConverters.fromJson(json['StartUtc'],'DateTime',context!);
        CalledUtc = JsonConverters.fromJson(json['CalledUtc'],'DateTime',context!);
        ServedToday = json['ServedToday'];
        LastCalledUtc = JsonConverters.fromJson(json['LastCalledUtc'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'StationId': StationId,
        'Name': Name,
        'Status': Status,
        'EmployeeId': EmployeeId,
        'EmployeeName': EmployeeName,
        'SignedInUtc': JsonConverters.toJson(SignedInUtc,'DateTime',context!),
        'LastSeenUtc': JsonConverters.toJson(LastSeenUtc,'DateTime',context!),
        'SinceUtc': JsonConverters.toJson(SinceUtc,'DateTime',context!),
        'PauseReason': PauseReason,
        'CheckinId': CheckinId,
        'TicketLabel': TicketLabel,
        'CustomerName': CustomerName,
        'ServiceName': ServiceName,
        'StartUtc': JsonConverters.toJson(StartUtc,'DateTime',context!),
        'CalledUtc': JsonConverters.toJson(CalledUtc,'DateTime',context!),
        'ServedToday': ServedToday,
        'LastCalledUtc': JsonConverters.toJson(LastCalledUtc,'DateTime',context!)
    };

    getTypeName() => "SvcLiveWindow";
    TypeContext? context = _ctx;
}

class SvcLiveLine implements IConvertible
{
    String? LineId;
    String? Name;
    int? Waiting;
    DateTime? OldestHereUtc;

    SvcLiveLine({this.LineId,this.Name,this.Waiting,this.OldestHereUtc});
    SvcLiveLine.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        LineId = json['LineId'];
        Name = json['Name'];
        Waiting = json['Waiting'];
        OldestHereUtc = JsonConverters.fromJson(json['OldestHereUtc'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'LineId': LineId,
        'Name': Name,
        'Waiting': Waiting,
        'OldestHereUtc': JsonConverters.toJson(OldestHereUtc,'DateTime',context!)
    };

    getTypeName() => "SvcLiveLine";
    TypeContext? context = _ctx;
}

class SvcAlert implements IConvertible
{
    String? Level;
    String? View;
    String? Code;
    String? StationId;
    String? EmployeeId;
    String? BranchId;
    String? LineId;
    String? Name;
    String? OtherLineId;
    String? OtherName;
    List<String>? StationIds = [];
    Map<String,double?>? Values = {};

    SvcAlert({this.Level,this.View,this.Code,this.StationId,this.EmployeeId,this.BranchId,this.LineId,this.Name,this.OtherLineId,this.OtherName,this.StationIds,this.Values});
    SvcAlert.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Level = json['Level'];
        View = json['View'];
        Code = json['Code'];
        StationId = json['StationId'];
        EmployeeId = json['EmployeeId'];
        BranchId = json['BranchId'];
        LineId = json['LineId'];
        Name = json['Name'];
        OtherLineId = json['OtherLineId'];
        OtherName = json['OtherName'];
        StationIds = JsonConverters.fromJson(json['StationIds'],'List<String>',context!);
        Values = JsonConverters.fromJson(json['Values'],'Map<String,double?>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Level': Level,
        'View': View,
        'Code': Code,
        'StationId': StationId,
        'EmployeeId': EmployeeId,
        'BranchId': BranchId,
        'LineId': LineId,
        'Name': Name,
        'OtherLineId': OtherLineId,
        'OtherName': OtherName,
        'StationIds': JsonConverters.toJson(StationIds,'List<String>',context!),
        'Values': JsonConverters.toJson(Values,'Map<String,double?>',context!)
    };

    getTypeName() => "SvcAlert";
    TypeContext? context = _ctx;
}

class SvcLive implements IConvertible
{
    String? BranchId;
    DateTime? NowUtc;
    int? LocalOffMin;
    String? ZoneCode;
    List<SvcLiveWindow>? Windows = [];
    List<SvcLiveLine>? Line = [];
    int? InLine;
    int? LongestWaitSec;
    int? Staffed;
    List<SvcAlert>? Alerts = [];

    SvcLive({this.BranchId,this.NowUtc,this.LocalOffMin,this.ZoneCode,this.Windows,this.Line,this.InLine,this.LongestWaitSec,this.Staffed,this.Alerts});
    SvcLive.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        BranchId = json['BranchId'];
        NowUtc = JsonConverters.fromJson(json['NowUtc'],'DateTime',context!);
        LocalOffMin = json['LocalOffMin'];
        ZoneCode = json['ZoneCode'];
        Windows = JsonConverters.fromJson(json['Windows'],'List<SvcLiveWindow>',context!);
        Line = JsonConverters.fromJson(json['Line'],'List<SvcLiveLine>',context!);
        InLine = json['InLine'];
        LongestWaitSec = json['LongestWaitSec'];
        Staffed = json['Staffed'];
        Alerts = JsonConverters.fromJson(json['Alerts'],'List<SvcAlert>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'BranchId': BranchId,
        'NowUtc': JsonConverters.toJson(NowUtc,'DateTime',context!),
        'LocalOffMin': LocalOffMin,
        'ZoneCode': ZoneCode,
        'Windows': JsonConverters.toJson(Windows,'List<SvcLiveWindow>',context!),
        'Line': JsonConverters.toJson(Line,'List<SvcLiveLine>',context!),
        'InLine': InLine,
        'LongestWaitSec': LongestWaitSec,
        'Staffed': Staffed,
        'Alerts': JsonConverters.toJson(Alerts,'List<SvcAlert>',context!)
    };

    getTypeName() => "SvcLive";
    TypeContext? context = _ctx;
}

class KpiV2LiveResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    SvcLive? Live;

    KpiV2LiveResponse({this.ResponseStatus,this.Live});
    KpiV2LiveResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        Live = JsonConverters.fromJson(json['Live'],'SvcLive',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Live': JsonConverters.toJson(Live,'SvcLive',context!)
    };

    getTypeName() => "KpiV2LiveResponse";
    TypeContext? context = _ctx;
}

class KpiV2LiveRequest implements IConvertible
{
    String? BranchId;

    KpiV2LiveRequest({this.BranchId});
    KpiV2LiveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        BranchId = json['BranchId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'BranchId': BranchId
    };

    getTypeName() => "KpiV2LiveRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'SvcLiveWindow': TypeInfo(TypeOf.Class, create:() => SvcLiveWindow()),
    'SvcLiveLine': TypeInfo(TypeOf.Class, create:() => SvcLiveLine()),
    'SvcAlert': TypeInfo(TypeOf.Class, create:() => SvcAlert()),
    'Map<String,double?>': TypeInfo(TypeOf.Class, create:() => Map<String,double?>()),
    'SvcLive': TypeInfo(TypeOf.Class, create:() => SvcLive()),
    'List<SvcLiveWindow>': TypeInfo(TypeOf.Class, create:() => <SvcLiveWindow>[]),
    'List<SvcLiveLine>': TypeInfo(TypeOf.Class, create:() => <SvcLiveLine>[]),
    'List<SvcAlert>': TypeInfo(TypeOf.Class, create:() => <SvcAlert>[]),
    'KpiV2LiveResponse': TypeInfo(TypeOf.Class, create:() => KpiV2LiveResponse()),
    'KpiV2LiveRequest': TypeInfo(TypeOf.Class, create:() => KpiV2LiveRequest()),
});

Dart KpiV2LiveRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/dashboard/kpiv2/live/{BranchId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<KpiV2LiveResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Live>
    <Alerts>
      <SvcAlert>
        <BranchId>00000000-0000-0000-0000-000000000000</BranchId>
        <Code>String</Code>
        <EmployeeId>00000000-0000-0000-0000-000000000000</EmployeeId>
        <Level>String</Level>
        <LineId>00000000-0000-0000-0000-000000000000</LineId>
        <Name>String</Name>
        <OtherLineId>00000000-0000-0000-0000-000000000000</OtherLineId>
        <OtherName>String</OtherName>
        <StationId>00000000-0000-0000-0000-000000000000</StationId>
        <StationIds xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:guid>00000000-0000-0000-0000-000000000000</d5p1:guid>
        </StationIds>
        <Values xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringdouble>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>0</d5p1:Value>
          </d5p1:KeyValueOfstringdouble>
        </Values>
        <View>String</View>
      </SvcAlert>
    </Alerts>
    <BranchId>00000000-0000-0000-0000-000000000000</BranchId>
    <InLine>0</InLine>
    <Line>
      <SvcLiveLine>
        <LineId>00000000-0000-0000-0000-000000000000</LineId>
        <Name>String</Name>
        <OldestHereUtc>0001-01-01T00:00:00</OldestHereUtc>
        <Waiting>0</Waiting>
      </SvcLiveLine>
    </Line>
    <LocalOffMin>0</LocalOffMin>
    <LongestWaitSec>0</LongestWaitSec>
    <NowUtc>0001-01-01T00:00:00</NowUtc>
    <Staffed>0</Staffed>
    <Windows>
      <SvcLiveWindow>
        <CalledUtc>0001-01-01T00:00:00</CalledUtc>
        <CheckinId>00000000-0000-0000-0000-000000000000</CheckinId>
        <CustomerName>String</CustomerName>
        <EmployeeId>00000000-0000-0000-0000-000000000000</EmployeeId>
        <EmployeeName>String</EmployeeName>
        <LastCalledUtc>0001-01-01T00:00:00</LastCalledUtc>
        <LastSeenUtc>0001-01-01T00:00:00</LastSeenUtc>
        <Name>String</Name>
        <PauseReason>String</PauseReason>
        <ServedToday>0</ServedToday>
        <ServiceName>String</ServiceName>
        <SignedInUtc>0001-01-01T00:00:00</SignedInUtc>
        <SinceUtc>0001-01-01T00:00:00</SinceUtc>
        <StartUtc>0001-01-01T00:00:00</StartUtc>
        <StationId>00000000-0000-0000-0000-000000000000</StationId>
        <Status>String</Status>
        <TicketLabel>String</TicketLabel>
      </SvcLiveWindow>
    </Windows>
    <ZoneCode>String</ZoneCode>
  </Live>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</KpiV2LiveResponse>