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

GET /v1/fleet/live HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
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
		}
	},
	Rows: 
	[
		{
			ContactID: 0,
			WorkerName: String,
			CrewID: 0,
			CrewName: String,
			BranchId: 00000000000000000000000000000000,
			LiveStatus: String,
			WorkerScheduleItemID: 0,
			JobID: 0,
			CurProperty: String,
			CurAddress: String,
			CurZip: String,
			EnRouteAt: String,
			StartedAt: String,
			LastLat: 0,
			LastLng: 0,
			LastLocAt: String,
			NextProperty: String,
			DoneVisits: 0,
			TotalVisits: 0
		}
	],
	ActiveWorkers: 0,
	EnRoute: 0,
	OnSite: 0,
	Waiting: 0,
	Done: 0,
	RunningLate: 0,
	PageTotal: 0,
	Page: 0,
	PageSize: 0
}