Trendsic Platform Service

<back to all web services

DispatchRequestAcceptRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dispatch/requests/{RequestId}/accept
import 'package:servicestack/servicestack.dart';

class DispatchRequestEventView implements IConvertible
{
    int? EventId;
    String? Kind;
    String? Detail;
    DateTime? AtUtc;
    String? ByWho;

    DispatchRequestEventView({this.EventId,this.Kind,this.Detail,this.AtUtc,this.ByWho});
    DispatchRequestEventView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        EventId = json['EventId'];
        Kind = json['Kind'];
        Detail = json['Detail'];
        AtUtc = JsonConverters.fromJson(json['AtUtc'],'DateTime',context!);
        ByWho = json['ByWho'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'EventId': EventId,
        'Kind': Kind,
        'Detail': Detail,
        'AtUtc': JsonConverters.toJson(AtUtc,'DateTime',context!),
        'ByWho': ByWho
    };

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

class DispatchRequestView implements IConvertible
{
    int? RequestId;
    String? Code;
    String? CustomerName;
    String? CustomerPhone;
    String? CustomerEmail;
    String? Cargo;
    int? Units;
    String? FromLoc;
    String? ToLoc;
    int? Miles;
    String? WindowText;
    bool? IsUrgent;
    String? Notes;
    String? Source;
    String? Status;
    String? RequiredRig;
    int? UnitsPerTruck;
    double? RatePerLoad;
    double? UrgencyPct;
    double? CostPerLoad;
    int? LoadsNeeded;
    double? QuoteTotal;
    int? QuoteVersion;
    DateTime? QuotedUtc;
    String? QuotedBy;
    DateTime? AcceptTokenExpiresUtc;
    DateTime? AcceptedUtc;
    String? AcceptedVia;
    DateTime? DeclinedUtc;
    String? DeclinedBy;
    String? DeclineReason;
    int? JobsCreated;
    int? JobsDone;
    int? JobsNeedDriver;
    DateTime? CreatedUtc;
    String? CreatedBy;
    List<DispatchRequestEventView>? Events = [];

    DispatchRequestView({this.RequestId,this.Code,this.CustomerName,this.CustomerPhone,this.CustomerEmail,this.Cargo,this.Units,this.FromLoc,this.ToLoc,this.Miles,this.WindowText,this.IsUrgent,this.Notes,this.Source,this.Status,this.RequiredRig,this.UnitsPerTruck,this.RatePerLoad,this.UrgencyPct,this.CostPerLoad,this.LoadsNeeded,this.QuoteTotal,this.QuoteVersion,this.QuotedUtc,this.QuotedBy,this.AcceptTokenExpiresUtc,this.AcceptedUtc,this.AcceptedVia,this.DeclinedUtc,this.DeclinedBy,this.DeclineReason,this.JobsCreated,this.JobsDone,this.JobsNeedDriver,this.CreatedUtc,this.CreatedBy,this.Events});
    DispatchRequestView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        RequestId = json['RequestId'];
        Code = json['Code'];
        CustomerName = json['CustomerName'];
        CustomerPhone = json['CustomerPhone'];
        CustomerEmail = json['CustomerEmail'];
        Cargo = json['Cargo'];
        Units = json['Units'];
        FromLoc = json['FromLoc'];
        ToLoc = json['ToLoc'];
        Miles = json['Miles'];
        WindowText = json['WindowText'];
        IsUrgent = json['IsUrgent'];
        Notes = json['Notes'];
        Source = json['Source'];
        Status = json['Status'];
        RequiredRig = json['RequiredRig'];
        UnitsPerTruck = json['UnitsPerTruck'];
        RatePerLoad = JsonConverters.toDouble(json['RatePerLoad']);
        UrgencyPct = JsonConverters.toDouble(json['UrgencyPct']);
        CostPerLoad = JsonConverters.toDouble(json['CostPerLoad']);
        LoadsNeeded = json['LoadsNeeded'];
        QuoteTotal = JsonConverters.toDouble(json['QuoteTotal']);
        QuoteVersion = json['QuoteVersion'];
        QuotedUtc = JsonConverters.fromJson(json['QuotedUtc'],'DateTime',context!);
        QuotedBy = json['QuotedBy'];
        AcceptTokenExpiresUtc = JsonConverters.fromJson(json['AcceptTokenExpiresUtc'],'DateTime',context!);
        AcceptedUtc = JsonConverters.fromJson(json['AcceptedUtc'],'DateTime',context!);
        AcceptedVia = json['AcceptedVia'];
        DeclinedUtc = JsonConverters.fromJson(json['DeclinedUtc'],'DateTime',context!);
        DeclinedBy = json['DeclinedBy'];
        DeclineReason = json['DeclineReason'];
        JobsCreated = json['JobsCreated'];
        JobsDone = json['JobsDone'];
        JobsNeedDriver = json['JobsNeedDriver'];
        CreatedUtc = JsonConverters.fromJson(json['CreatedUtc'],'DateTime',context!);
        CreatedBy = json['CreatedBy'];
        Events = JsonConverters.fromJson(json['Events'],'List<DispatchRequestEventView>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'RequestId': RequestId,
        'Code': Code,
        'CustomerName': CustomerName,
        'CustomerPhone': CustomerPhone,
        'CustomerEmail': CustomerEmail,
        'Cargo': Cargo,
        'Units': Units,
        'FromLoc': FromLoc,
        'ToLoc': ToLoc,
        'Miles': Miles,
        'WindowText': WindowText,
        'IsUrgent': IsUrgent,
        'Notes': Notes,
        'Source': Source,
        'Status': Status,
        'RequiredRig': RequiredRig,
        'UnitsPerTruck': UnitsPerTruck,
        'RatePerLoad': RatePerLoad,
        'UrgencyPct': UrgencyPct,
        'CostPerLoad': CostPerLoad,
        'LoadsNeeded': LoadsNeeded,
        'QuoteTotal': QuoteTotal,
        'QuoteVersion': QuoteVersion,
        'QuotedUtc': JsonConverters.toJson(QuotedUtc,'DateTime',context!),
        'QuotedBy': QuotedBy,
        'AcceptTokenExpiresUtc': JsonConverters.toJson(AcceptTokenExpiresUtc,'DateTime',context!),
        'AcceptedUtc': JsonConverters.toJson(AcceptedUtc,'DateTime',context!),
        'AcceptedVia': AcceptedVia,
        'DeclinedUtc': JsonConverters.toJson(DeclinedUtc,'DateTime',context!),
        'DeclinedBy': DeclinedBy,
        'DeclineReason': DeclineReason,
        'JobsCreated': JobsCreated,
        'JobsDone': JobsDone,
        'JobsNeedDriver': JobsNeedDriver,
        'CreatedUtc': JsonConverters.toJson(CreatedUtc,'DateTime',context!),
        'CreatedBy': CreatedBy,
        'Events': JsonConverters.toJson(Events,'List<DispatchRequestEventView>',context!)
    };

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

class DispatchRigCountView implements IConvertible
{
    String? RigType;
    int? Rigs;

    DispatchRigCountView({this.RigType,this.Rigs});
    DispatchRigCountView.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class DispatchCarrierPickView implements IConvertible
{
    int? VendorID;
    String? VendorName;

    DispatchCarrierPickView({this.VendorID,this.VendorName});
    DispatchCarrierPickView.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class DispatchRequestsResponse implements IConvertible
{
    List<DispatchRequestView>? Requests = [];
    DispatchRequestView? Request;
    List<DispatchRigCountView>? RigCounts = [];
    List<DispatchCarrierPickView>? Carriers = [];
    String? QuoteLink;
    String? Delivery;
    ResponseStatus? ResponseStatus;

    DispatchRequestsResponse({this.Requests,this.Request,this.RigCounts,this.Carriers,this.QuoteLink,this.Delivery,this.ResponseStatus});
    DispatchRequestsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Requests = JsonConverters.fromJson(json['Requests'],'List<DispatchRequestView>',context!);
        Request = JsonConverters.fromJson(json['Request'],'DispatchRequestView',context!);
        RigCounts = JsonConverters.fromJson(json['RigCounts'],'List<DispatchRigCountView>',context!);
        Carriers = JsonConverters.fromJson(json['Carriers'],'List<DispatchCarrierPickView>',context!);
        QuoteLink = json['QuoteLink'];
        Delivery = json['Delivery'];
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Requests': JsonConverters.toJson(Requests,'List<DispatchRequestView>',context!),
        'Request': JsonConverters.toJson(Request,'DispatchRequestView',context!),
        'RigCounts': JsonConverters.toJson(RigCounts,'List<DispatchRigCountView>',context!),
        'Carriers': JsonConverters.toJson(Carriers,'List<DispatchCarrierPickView>',context!),
        'QuoteLink': QuoteLink,
        'Delivery': Delivery,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class DispatchRequestAcceptRequest implements IConvertible
{
    int? RequestId;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'DispatchRequestEventView': TypeInfo(TypeOf.Class, create:() => DispatchRequestEventView()),
    'DispatchRequestView': TypeInfo(TypeOf.Class, create:() => DispatchRequestView()),
    'List<DispatchRequestEventView>': TypeInfo(TypeOf.Class, create:() => <DispatchRequestEventView>[]),
    'DispatchRigCountView': TypeInfo(TypeOf.Class, create:() => DispatchRigCountView()),
    'DispatchCarrierPickView': TypeInfo(TypeOf.Class, create:() => DispatchCarrierPickView()),
    'DispatchRequestsResponse': TypeInfo(TypeOf.Class, create:() => DispatchRequestsResponse()),
    'List<DispatchRequestView>': TypeInfo(TypeOf.Class, create:() => <DispatchRequestView>[]),
    'List<DispatchRigCountView>': TypeInfo(TypeOf.Class, create:() => <DispatchRigCountView>[]),
    'List<DispatchCarrierPickView>': TypeInfo(TypeOf.Class, create:() => <DispatchCarrierPickView>[]),
    'DispatchRequestAcceptRequest': TypeInfo(TypeOf.Class, create:() => DispatchRequestAcceptRequest()),
});

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

POST /v1/dispatch/requests/{RequestId}/accept HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<DispatchRequestAcceptRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <RequestId>0</RequestId>
</DispatchRequestAcceptRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DispatchRequestsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Carriers>
    <DispatchCarrierPickView>
      <VendorID>0</VendorID>
      <VendorName>String</VendorName>
    </DispatchCarrierPickView>
  </Carriers>
  <Delivery>String</Delivery>
  <QuoteLink>String</QuoteLink>
  <Request>
    <AcceptTokenExpiresUtc>0001-01-01T00:00:00</AcceptTokenExpiresUtc>
    <AcceptedUtc>0001-01-01T00:00:00</AcceptedUtc>
    <AcceptedVia>String</AcceptedVia>
    <Cargo>String</Cargo>
    <Code>String</Code>
    <CostPerLoad>0</CostPerLoad>
    <CreatedBy>String</CreatedBy>
    <CreatedUtc>0001-01-01T00:00:00</CreatedUtc>
    <CustomerEmail>String</CustomerEmail>
    <CustomerName>String</CustomerName>
    <CustomerPhone>String</CustomerPhone>
    <DeclineReason>String</DeclineReason>
    <DeclinedBy>String</DeclinedBy>
    <DeclinedUtc>0001-01-01T00:00:00</DeclinedUtc>
    <Events>
      <DispatchRequestEventView>
        <AtUtc>0001-01-01T00:00:00</AtUtc>
        <ByWho>String</ByWho>
        <Detail>String</Detail>
        <EventId>0</EventId>
        <Kind>String</Kind>
      </DispatchRequestEventView>
    </Events>
    <FromLoc>String</FromLoc>
    <IsUrgent>false</IsUrgent>
    <JobsCreated>0</JobsCreated>
    <JobsDone>0</JobsDone>
    <JobsNeedDriver>0</JobsNeedDriver>
    <LoadsNeeded>0</LoadsNeeded>
    <Miles>0</Miles>
    <Notes>String</Notes>
    <QuoteTotal>0</QuoteTotal>
    <QuoteVersion>0</QuoteVersion>
    <QuotedBy>String</QuotedBy>
    <QuotedUtc>0001-01-01T00:00:00</QuotedUtc>
    <RatePerLoad>0</RatePerLoad>
    <RequestId>0</RequestId>
    <RequiredRig>String</RequiredRig>
    <Source>String</Source>
    <Status>String</Status>
    <ToLoc>String</ToLoc>
    <Units>0</Units>
    <UnitsPerTruck>0</UnitsPerTruck>
    <UrgencyPct>0</UrgencyPct>
    <WindowText>String</WindowText>
  </Request>
  <Requests>
    <DispatchRequestView>
      <AcceptTokenExpiresUtc>0001-01-01T00:00:00</AcceptTokenExpiresUtc>
      <AcceptedUtc>0001-01-01T00:00:00</AcceptedUtc>
      <AcceptedVia>String</AcceptedVia>
      <Cargo>String</Cargo>
      <Code>String</Code>
      <CostPerLoad>0</CostPerLoad>
      <CreatedBy>String</CreatedBy>
      <CreatedUtc>0001-01-01T00:00:00</CreatedUtc>
      <CustomerEmail>String</CustomerEmail>
      <CustomerName>String</CustomerName>
      <CustomerPhone>String</CustomerPhone>
      <DeclineReason>String</DeclineReason>
      <DeclinedBy>String</DeclinedBy>
      <DeclinedUtc>0001-01-01T00:00:00</DeclinedUtc>
      <Events>
        <DispatchRequestEventView>
          <AtUtc>0001-01-01T00:00:00</AtUtc>
          <ByWho>String</ByWho>
          <Detail>String</Detail>
          <EventId>0</EventId>
          <Kind>String</Kind>
        </DispatchRequestEventView>
      </Events>
      <FromLoc>String</FromLoc>
      <IsUrgent>false</IsUrgent>
      <JobsCreated>0</JobsCreated>
      <JobsDone>0</JobsDone>
      <JobsNeedDriver>0</JobsNeedDriver>
      <LoadsNeeded>0</LoadsNeeded>
      <Miles>0</Miles>
      <Notes>String</Notes>
      <QuoteTotal>0</QuoteTotal>
      <QuoteVersion>0</QuoteVersion>
      <QuotedBy>String</QuotedBy>
      <QuotedUtc>0001-01-01T00:00:00</QuotedUtc>
      <RatePerLoad>0</RatePerLoad>
      <RequestId>0</RequestId>
      <RequiredRig>String</RequiredRig>
      <Source>String</Source>
      <Status>String</Status>
      <ToLoc>String</ToLoc>
      <Units>0</Units>
      <UnitsPerTruck>0</UnitsPerTruck>
      <UrgencyPct>0</UrgencyPct>
      <WindowText>String</WindowText>
    </DispatchRequestView>
  </Requests>
  <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>
  <RigCounts>
    <DispatchRigCountView>
      <RigType>String</RigType>
      <Rigs>0</Rigs>
    </DispatchRigCountView>
  </RigCounts>
</DispatchRequestsResponse>