| POST,OPTIONS | /v1/dispatch/track/{Token}/rating |
|---|
import Foundation
import ServiceStack
public class CourierTrackRatingRequest : CourierTrackActRequest
{
public var stars:Int
public var tags:[String] = []
public var tip:Double?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case stars
case tags
case tip
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
stars = try container.decodeIfPresent(Int.self, forKey: .stars)
tags = try container.decodeIfPresent([String].self, forKey: .tags) ?? []
tip = try container.decodeIfPresent(Double.self, forKey: .tip)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if stars != nil { try container.encode(stars, forKey: .stars) }
if tags.count > 0 { try container.encode(tags, forKey: .tags) }
if tip != nil { try container.encode(tip, forKey: .tip) }
}
}
public class CourierTrackActRequest : Codable
{
public var token:String
public var actToken:String
required public init(){}
}
public class DispatchTrackResponse : Codable
{
public var kind:String
public var code:String
public var what:String
public var fromLoc:String
public var toLoc:String
public var bags:Int?
public var fare:Double?
public var payMode:String
public var cardLast4:String
public var charged:Bool
public var stage:String
public var headline:String
public var sub:String
public var isClosed:Bool
public var eta:String
public var driverName:String
public var customerName:String
public var steps:[DispatchTrackStepView] = []
public var expired:Bool
public var invalid:Bool
public var business:CourierTrackBusiness
public var courier:CourierTrackView
public var notice:String
public var responseStatus:ResponseStatus
required public init(){}
}
public class DispatchTrackStepView : Codable
{
public var name:String
public var at:Date?
public var done:Bool
public var current:Bool
required public init(){}
}
public class CourierTrackBusiness : Codable
{
public var name:String
public var phone:String
required public init(){}
}
public class CourierTrackView : Codable
{
public var state:String
public var code:String
public var runCode:String
public var shape:String
public var template:String
public var courierStep:String
public var unitOne:String
public var unitMany:String
public var unitOneEs:String
public var unitManyEs:String
public var facilityNoun:String
public var facilityNounEs:String
public var units:Int
public var unitsCounted:Bool
public var address:String
public var dropoffAddress:String
public var dropoffName:String
public var instructions:String
public var gateCode:String
public var handoff:String
public var levelName:String
public var readyPromise:String
public var windowText:String
public var isAsap:Bool
public var times:[String:String] = [:]
public var stopPosition:Int?
public var stopCount:Int?
public var deliveryWindowText:String
public var driver:CourierTrackDriver
public var proof:CourierTrackProof
public var handoffCode:String
public var rating:CourierTrackRating
public var tipAllowed:Bool
public var tipsPct:Double
public var missed:CourierTrackMissed
public var cancelFee:Double
public var cancelFeeCharged:Double
public var cancelledBy:String
public var bookUrl:String
public var can:CourierTrackCan
public var deliverySlots:[CourierTrackSlot] = []
public var messages:[CourierTrackMessage] = []
public var messagesOpen:Bool
public var caseCode:String
public var caseStatus:String
public var caseReply:String
public var threadHrs:Int
public var expiresUtc:Date?
public var liveEta:Bool
public var live:Bool
public var serverUtc:Date
required public init(){}
}
public class CourierTrackDriver : Codable
{
public var firstName:String
public var initial:String
public var vehicle:String
public var plate:String
public var etaMin:Int?
public var etaPct:Int?
required public init(){}
}
public class CourierTrackProof : Codable
{
public var kind:String
public var photoUrl:String
public var atText:String
public var gpsOk:Bool
public var units:Int
public var damageNote:String
public var deliveredTo:String
public var waitedMin:Int
public var attempts:Int
public var contactedText:String
public var eachTagged:Bool
public var eachScanned:Bool
required public init(){}
}
public class CourierTrackRating : Codable
{
public var stars:Int
public var tags:String
public var tip:Double
public var tipStatus:String
required public init(){}
}
public class CourierTrackMissed : Codable
{
public var code:String
public var fee:Double
public var waitedMin:Int
public var autoRebook:Bool
public var rebookWindowText:String
public var slots:[CourierTrackSlot] = []
required public init(){}
}
public class CourierTrackSlot : Codable
{
public var id:String
public var day:String
public var dayEs:String
public var win:String
required public init(){}
}
public class CourierTrackCan : Codable
{
public var editInstructions:Bool
public var changeUnits:Bool
public var cancel:Bool
public var rescheduleDelivery:Bool
public var rebook:Bool
public var rate:Bool
public var message:Bool
public var report:Bool
public var maxUnits:Int
required public init(){}
}
public class CourierTrackMessage : Codable
{
public var who:String
public var mine:Bool
public var office:Bool
public var atText:String
public var body:String
required public init(){}
}
Swift CourierTrackRatingRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/dispatch/track/{Token}/rating HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CourierTrackRatingRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<ActToken>String</ActToken>
<Token>String</Token>
<Stars>0</Stars>
<Tags xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Tags>
<Tip>0</Tip>
</CourierTrackRatingRequest>
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>
<Business>
<Name>String</Name>
<Phone>String</Phone>
</Business>
<CardLast4>String</CardLast4>
<Charged>false</Charged>
<Code>String</Code>
<Courier>
<Address>String</Address>
<BookUrl>String</BookUrl>
<Can>
<Cancel>false</Cancel>
<ChangeUnits>false</ChangeUnits>
<EditInstructions>false</EditInstructions>
<MaxUnits>0</MaxUnits>
<Message>false</Message>
<Rate>false</Rate>
<Rebook>false</Rebook>
<Report>false</Report>
<RescheduleDelivery>false</RescheduleDelivery>
</Can>
<CancelFee>0</CancelFee>
<CancelFeeCharged>0</CancelFeeCharged>
<CancelledBy>String</CancelledBy>
<CaseCode>String</CaseCode>
<CaseReply>String</CaseReply>
<CaseStatus>String</CaseStatus>
<Code>String</Code>
<CourierStep>String</CourierStep>
<DeliverySlots>
<CourierTrackSlot>
<Day>String</Day>
<DayEs>String</DayEs>
<Id>String</Id>
<Win>String</Win>
</CourierTrackSlot>
</DeliverySlots>
<DeliveryWindowText>String</DeliveryWindowText>
<Driver>
<EtaMin>0</EtaMin>
<EtaPct>0</EtaPct>
<FirstName>String</FirstName>
<Initial>String</Initial>
<Plate>String</Plate>
<Vehicle>String</Vehicle>
</Driver>
<DropoffAddress>String</DropoffAddress>
<DropoffName>String</DropoffName>
<ExpiresUtc>0001-01-01T00:00:00</ExpiresUtc>
<FacilityNoun>String</FacilityNoun>
<FacilityNounEs>String</FacilityNounEs>
<GateCode>String</GateCode>
<Handoff>String</Handoff>
<HandoffCode>String</HandoffCode>
<Instructions>String</Instructions>
<IsAsap>false</IsAsap>
<LevelName>String</LevelName>
<Live>false</Live>
<LiveEta>false</LiveEta>
<Messages>
<CourierTrackMessage>
<AtText>String</AtText>
<Body>String</Body>
<Mine>false</Mine>
<Office>false</Office>
<Who>String</Who>
</CourierTrackMessage>
</Messages>
<MessagesOpen>false</MessagesOpen>
<Missed>
<AutoRebook>false</AutoRebook>
<Code>String</Code>
<Fee>0</Fee>
<RebookWindowText>String</RebookWindowText>
<Slots>
<CourierTrackSlot>
<Day>String</Day>
<DayEs>String</DayEs>
<Id>String</Id>
<Win>String</Win>
</CourierTrackSlot>
</Slots>
<WaitedMin>0</WaitedMin>
</Missed>
<Proof>
<AtText>String</AtText>
<Attempts>0</Attempts>
<ContactedText>String</ContactedText>
<DamageNote>String</DamageNote>
<DeliveredTo>String</DeliveredTo>
<EachScanned>false</EachScanned>
<EachTagged>false</EachTagged>
<GpsOk>false</GpsOk>
<Kind>String</Kind>
<PhotoUrl>String</PhotoUrl>
<Units>0</Units>
<WaitedMin>0</WaitedMin>
</Proof>
<Rating>
<Stars>0</Stars>
<Tags>String</Tags>
<Tip>0</Tip>
<TipStatus>String</TipStatus>
</Rating>
<ReadyPromise>String</ReadyPromise>
<RunCode>String</RunCode>
<ServerUtc>0001-01-01T00:00:00</ServerUtc>
<Shape>String</Shape>
<State>String</State>
<StopCount>0</StopCount>
<StopPosition>0</StopPosition>
<Template>String</Template>
<ThreadHrs>0</ThreadHrs>
<Times xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</Times>
<TipAllowed>false</TipAllowed>
<TipsPct>0</TipsPct>
<UnitMany>String</UnitMany>
<UnitManyEs>String</UnitManyEs>
<UnitOne>String</UnitOne>
<UnitOneEs>String</UnitOneEs>
<Units>0</Units>
<UnitsCounted>false</UnitsCounted>
<WindowText>String</WindowText>
</Courier>
<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>
<Notice>String</Notice>
<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>