Trendsic Platform Service

<back to all web services

DispatchTrackRequest

The following routes are available for this service:
GET,OPTIONS/v1/dispatch/track/{Token}/json
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class DispatchTrackStepView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var DateTime|null */
        public ?DateTime $At=null,
        /** @var bool|null */
        public ?bool $Done=null,
        /** @var bool|null */
        public ?bool $Current=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['At'])) $this->At = JsonConverters::from('DateTime', $o['At']);
        if (isset($o['Done'])) $this->Done = $o['Done'];
        if (isset($o['Current'])) $this->Current = $o['Current'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->At)) $o['At'] = JsonConverters::to('DateTime', $this->At);
        if (isset($this->Done)) $o['Done'] = $this->Done;
        if (isset($this->Current)) $o['Current'] = $this->Current;
        return empty($o) ? new class(){} : $o;
    }
}

class DispatchTrackResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $What=null,
        /** @var string|null */
        public ?string $FromLoc=null,
        /** @var string|null */
        public ?string $ToLoc=null,
        /** @var int|null */
        public ?int $Bags=null,
        /** @var float|null */
        public ?float $Fare=null,
        /** @var string|null */
        public ?string $PayMode=null,
        /** @var string|null */
        public ?string $CardLast4=null,
        /** @var bool|null */
        public ?bool $Charged=null,
        /** @var string|null */
        public ?string $Stage=null,
        /** @var string|null */
        public ?string $Headline=null,
        /** @var string|null */
        public ?string $Sub=null,
        /** @var bool|null */
        public ?bool $IsClosed=null,
        /** @var string|null */
        public ?string $Eta=null,
        /** @var string|null */
        public ?string $DriverName=null,
        /** @var string|null */
        public ?string $CustomerName=null,
        /** @var array<DispatchTrackStepView>|null */
        public ?array $Steps=null,
        /** @var bool|null */
        public ?bool $Expired=null,
        /** @var bool|null */
        public ?bool $Invalid=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['What'])) $this->What = $o['What'];
        if (isset($o['FromLoc'])) $this->FromLoc = $o['FromLoc'];
        if (isset($o['ToLoc'])) $this->ToLoc = $o['ToLoc'];
        if (isset($o['Bags'])) $this->Bags = $o['Bags'];
        if (isset($o['Fare'])) $this->Fare = $o['Fare'];
        if (isset($o['PayMode'])) $this->PayMode = $o['PayMode'];
        if (isset($o['CardLast4'])) $this->CardLast4 = $o['CardLast4'];
        if (isset($o['Charged'])) $this->Charged = $o['Charged'];
        if (isset($o['Stage'])) $this->Stage = $o['Stage'];
        if (isset($o['Headline'])) $this->Headline = $o['Headline'];
        if (isset($o['Sub'])) $this->Sub = $o['Sub'];
        if (isset($o['IsClosed'])) $this->IsClosed = $o['IsClosed'];
        if (isset($o['Eta'])) $this->Eta = $o['Eta'];
        if (isset($o['DriverName'])) $this->DriverName = $o['DriverName'];
        if (isset($o['CustomerName'])) $this->CustomerName = $o['CustomerName'];
        if (isset($o['Steps'])) $this->Steps = JsonConverters::fromArray('DispatchTrackStepView', $o['Steps']);
        if (isset($o['Expired'])) $this->Expired = $o['Expired'];
        if (isset($o['Invalid'])) $this->Invalid = $o['Invalid'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->What)) $o['What'] = $this->What;
        if (isset($this->FromLoc)) $o['FromLoc'] = $this->FromLoc;
        if (isset($this->ToLoc)) $o['ToLoc'] = $this->ToLoc;
        if (isset($this->Bags)) $o['Bags'] = $this->Bags;
        if (isset($this->Fare)) $o['Fare'] = $this->Fare;
        if (isset($this->PayMode)) $o['PayMode'] = $this->PayMode;
        if (isset($this->CardLast4)) $o['CardLast4'] = $this->CardLast4;
        if (isset($this->Charged)) $o['Charged'] = $this->Charged;
        if (isset($this->Stage)) $o['Stage'] = $this->Stage;
        if (isset($this->Headline)) $o['Headline'] = $this->Headline;
        if (isset($this->Sub)) $o['Sub'] = $this->Sub;
        if (isset($this->IsClosed)) $o['IsClosed'] = $this->IsClosed;
        if (isset($this->Eta)) $o['Eta'] = $this->Eta;
        if (isset($this->DriverName)) $o['DriverName'] = $this->DriverName;
        if (isset($this->CustomerName)) $o['CustomerName'] = $this->CustomerName;
        if (isset($this->Steps)) $o['Steps'] = JsonConverters::toArray('DispatchTrackStepView', $this->Steps);
        if (isset($this->Expired)) $o['Expired'] = $this->Expired;
        if (isset($this->Invalid)) $o['Invalid'] = $this->Invalid;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class DispatchTrackRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Token=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Token'])) $this->Token = $o['Token'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Token)) $o['Token'] = $this->Token;
        return empty($o) ? new class(){} : $o;
    }
}

PHP 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>