Trendsic Platform Service

<back to all web services

DispatchTrackRequest

The following routes are available for this service:
GET,OPTIONS/v1/dispatch/track/{Token}/json
import 'package:servicestack/servicestack.dart';

class DispatchTrackStepView implements IConvertible
{
    String? Name;
    DateTime? At;
    bool? Done;
    bool? Current;

    DispatchTrackStepView({this.Name,this.At,this.Done,this.Current});
    DispatchTrackStepView.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Name': Name,
        'At': JsonConverters.toJson(At,'DateTime',context!),
        'Done': Done,
        'Current': Current
    };

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

class DispatchTrackResponse implements IConvertible
{
    String? Kind;
    String? Code;
    String? What;
    String? FromLoc;
    String? ToLoc;
    int? Bags;
    double? Fare;
    String? PayMode;
    String? CardLast4;
    bool? Charged;
    String? Stage;
    String? Headline;
    String? Sub;
    bool? IsClosed;
    String? Eta;
    String? DriverName;
    String? CustomerName;
    List<DispatchTrackStepView>? Steps = [];
    bool? Expired;
    bool? Invalid;
    ResponseStatus? ResponseStatus;

    DispatchTrackResponse({this.Kind,this.Code,this.What,this.FromLoc,this.ToLoc,this.Bags,this.Fare,this.PayMode,this.CardLast4,this.Charged,this.Stage,this.Headline,this.Sub,this.IsClosed,this.Eta,this.DriverName,this.CustomerName,this.Steps,this.Expired,this.Invalid,this.ResponseStatus});
    DispatchTrackResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Kind = json['Kind'];
        Code = json['Code'];
        What = json['What'];
        FromLoc = json['FromLoc'];
        ToLoc = json['ToLoc'];
        Bags = json['Bags'];
        Fare = JsonConverters.toDouble(json['Fare']);
        PayMode = json['PayMode'];
        CardLast4 = json['CardLast4'];
        Charged = json['Charged'];
        Stage = json['Stage'];
        Headline = json['Headline'];
        Sub = json['Sub'];
        IsClosed = json['IsClosed'];
        Eta = json['Eta'];
        DriverName = json['DriverName'];
        CustomerName = json['CustomerName'];
        Steps = JsonConverters.fromJson(json['Steps'],'List<DispatchTrackStepView>',context!);
        Expired = json['Expired'];
        Invalid = json['Invalid'];
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Kind': Kind,
        'Code': Code,
        'What': What,
        'FromLoc': FromLoc,
        'ToLoc': ToLoc,
        'Bags': Bags,
        'Fare': Fare,
        'PayMode': PayMode,
        'CardLast4': CardLast4,
        'Charged': Charged,
        'Stage': Stage,
        'Headline': Headline,
        'Sub': Sub,
        'IsClosed': IsClosed,
        'Eta': Eta,
        'DriverName': DriverName,
        'CustomerName': CustomerName,
        'Steps': JsonConverters.toJson(Steps,'List<DispatchTrackStepView>',context!),
        'Expired': Expired,
        'Invalid': Invalid,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class DispatchTrackRequest implements IConvertible
{
    String? Token;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'DispatchTrackStepView': TypeInfo(TypeOf.Class, create:() => DispatchTrackStepView()),
    'DispatchTrackResponse': TypeInfo(TypeOf.Class, create:() => DispatchTrackResponse()),
    'List<DispatchTrackStepView>': TypeInfo(TypeOf.Class, create:() => <DispatchTrackStepView>[]),
    'DispatchTrackRequest': TypeInfo(TypeOf.Class, create:() => DispatchTrackRequest()),
});

Dart DispatchTrackRequest 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/dispatch/track/{Token}/json HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DispatchTrackResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Bags>0</Bags>
  <CardLast4>String</CardLast4>
  <Charged>false</Charged>
  <Code>String</Code>
  <CustomerName>String</CustomerName>
  <DriverName>String</DriverName>
  <Eta>String</Eta>
  <Expired>false</Expired>
  <Fare>0</Fare>
  <FromLoc>String</FromLoc>
  <Headline>String</Headline>
  <Invalid>false</Invalid>
  <IsClosed>false</IsClosed>
  <Kind>String</Kind>
  <PayMode>String</PayMode>
  <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>
  <Stage>String</Stage>
  <Steps>
    <DispatchTrackStepView>
      <At>0001-01-01T00:00:00</At>
      <Current>false</Current>
      <Done>false</Done>
      <Name>String</Name>
    </DispatchTrackStepView>
  </Steps>
  <Sub>String</Sub>
  <ToLoc>String</ToLoc>
  <What>String</What>
</DispatchTrackResponse>