Trendsic Platform Service

<back to all web services

FleetLiveRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/fleet/live
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FleetRowDto:
    contact_i_d: int = 0
    worker_name: Optional[str] = None
    crew_i_d: Optional[int] = None
    crew_name: Optional[str] = None
    branch_id: Optional[str] = None
    live_status: Optional[str] = None
    worker_schedule_item_i_d: Optional[int] = None
    job_i_d: Optional[int] = None
    cur_property: Optional[str] = None
    cur_address: Optional[str] = None
    cur_zip: Optional[str] = None
    en_route_at: Optional[str] = None
    started_at: Optional[str] = None
    last_lat: Optional[Decimal] = None
    last_lng: Optional[Decimal] = None
    last_loc_at: Optional[str] = None
    next_property: Optional[str] = None
    done_visits: int = 0
    total_visits: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FleetLiveResponse:
    response_status: Optional[ResponseStatus] = None
    rows: List[FleetRowDto] = field(default_factory=list)
    active_workers: int = 0
    en_route: int = 0
    on_site: int = 0
    waiting: int = 0
    done: int = 0
    running_late: int = 0
    page_total: int = 0
    page: int = 0
    page_size: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FleetLiveRequest:
    date: Optional[str] = None
    status: Optional[str] = None
    crew_i_d: Optional[int] = None
    zip: Optional[str] = None
    branch_id: Optional[str] = None
    search: Optional[str] = None
    page: int = 0
    page_size: int = 0

Python FleetLiveRequest 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/fleet/live HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FleetLiveResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ActiveWorkers>0</ActiveWorkers>
  <Done>0</Done>
  <EnRoute>0</EnRoute>
  <OnSite>0</OnSite>
  <Page>0</Page>
  <PageSize>0</PageSize>
  <PageTotal>0</PageTotal>
  <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>
  <Rows>
    <FleetRowDto>
      <BranchId>00000000-0000-0000-0000-000000000000</BranchId>
      <ContactID>0</ContactID>
      <CrewID>0</CrewID>
      <CrewName>String</CrewName>
      <CurAddress>String</CurAddress>
      <CurProperty>String</CurProperty>
      <CurZip>String</CurZip>
      <DoneVisits>0</DoneVisits>
      <EnRouteAt>String</EnRouteAt>
      <JobID>0</JobID>
      <LastLat>0</LastLat>
      <LastLng>0</LastLng>
      <LastLocAt>String</LastLocAt>
      <LiveStatus>String</LiveStatus>
      <NextProperty>String</NextProperty>
      <StartedAt>String</StartedAt>
      <TotalVisits>0</TotalVisits>
      <WorkerName>String</WorkerName>
      <WorkerScheduleItemID>0</WorkerScheduleItemID>
    </FleetRowDto>
  </Rows>
  <RunningLate>0</RunningLate>
  <Waiting>0</Waiting>
</FleetLiveResponse>