Field Squared API Services

<back to all web services

ProposeRouteRequest

The following routes are available for this service:
POST/{Workspace}/ProposeRoute
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Field2Office.API.Model.MapRoute;
using Field2Office.DomainObjects.Model;
using Field2Office.API.Model;
using Field2Office.API.Model.Schedules;

namespace Field2Office.API.Model
{
    public partial class Location
    {
        public virtual double y { get; set; }
        public virtual double x { get; set; }
    }

}

namespace Field2Office.API.Model.MapRoute
{
    public partial class ProposeRouteRequest
    {
        public ProposeRouteRequest()
        {
            Nodes = new List<RouteNode>{};
        }

        public virtual string Workspace { get; set; }
        public virtual List<RouteNode> Nodes { get; set; }
        public virtual bool AllowReorder { get; set; }
        public virtual Location StartLocation { get; set; }
        public virtual Location EndLocation { get; set; }
        public virtual bool ShortestDistance { get; set; }
        public virtual string StartTime { get; set; }
        public virtual bool StartClockAtFirstNode { get; set; }
        public virtual int RoundStartTimes { get; set; }
        public virtual int TransitionTime { get; set; }
        public virtual string LunchStart { get; set; }
        public virtual int LunchDuration { get; set; }
        public virtual int Time { get; set; }
        public virtual int RealTime { get; set; }
        public virtual double Distance { get; set; }
    }

    public partial class RouteNode
        : ClassedItem
    {
        public virtual Location Location { get; set; }
        public virtual int StopTime { get; set; }
        public virtual Schedule Schedule { get; set; }
        public virtual string Name { get; set; }
    }

}

namespace Field2Office.API.Model.Schedules
{
    public partial class Schedule
    {
        public Schedule()
        {
            Users = new List<string>{};
            Teams = new List<string>{};
            Data = new Dictionary<string, Object>{};
        }

        public virtual string Workspace { get; set; }
        public virtual string ObjectId { get; set; }
        public virtual string VersionId { get; set; }
        public virtual string BasedOn { get; set; }
        public virtual string Start { get; set; }
        public virtual string End { get; set; }
        public virtual string TimeZone { get; set; }
        public virtual List<string> Users { get; set; }
        public virtual List<string> Teams { get; set; }
        public virtual Dictionary<string, Object> Data { get; set; }
    }

}

namespace Field2Office.DomainObjects.Model
{
    public partial class ClassedItem
    {
        public ClassedItem()
        {
            Ancestors = new List<string>{};
        }

        public virtual string ObjectId { get; set; }
        public virtual string Class { get; set; }
        public virtual string VersionId { get; set; }
        public virtual List<string> Ancestors { get; set; }
        public virtual string Type { get; set; }
    }

}

C# ProposeRouteRequest 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 /{Workspace}/ProposeRoute HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<ProposeRouteRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.MapRoute">
  <AllowReorder>false</AllowReorder>
  <Distance>0</Distance>
  <EndLocation xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
    <d2p1:x>0</d2p1:x>
    <d2p1:y>0</d2p1:y>
  </EndLocation>
  <LunchDuration>0</LunchDuration>
  <LunchStart>String</LunchStart>
  <Nodes>
    <RouteNode>
      <Ancestors xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.DomainObjects.Model">
        <d4p1:string>String</d4p1:string>
      </Ancestors>
      <Class xmlns="http://schemas.datacontract.org/2004/07/Field2Office.DomainObjects.Model">String</Class>
      <ObjectId xmlns="http://schemas.datacontract.org/2004/07/Field2Office.DomainObjects.Model">String</ObjectId>
      <Type xmlns="http://schemas.datacontract.org/2004/07/Field2Office.DomainObjects.Model">String</Type>
      <VersionId xmlns="http://schemas.datacontract.org/2004/07/Field2Office.DomainObjects.Model">String</VersionId>
      <Location xmlns:d4p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
        <d4p1:x>0</d4p1:x>
        <d4p1:y>0</d4p1:y>
      </Location>
      <Name>String</Name>
      <Schedule xmlns:d4p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Schedules">
        <d4p1:BasedOn>String</d4p1:BasedOn>
        <d4p1:Data xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringanyType>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value />
          </d5p1:KeyValueOfstringanyType>
        </d4p1:Data>
        <d4p1:End>String</d4p1:End>
        <d4p1:ObjectId>String</d4p1:ObjectId>
        <d4p1:Start>String</d4p1:Start>
        <d4p1:Teams xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:string>String</d5p1:string>
        </d4p1:Teams>
        <d4p1:TimeZone>String</d4p1:TimeZone>
        <d4p1:Users xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:string>String</d5p1:string>
        </d4p1:Users>
        <d4p1:VersionId>String</d4p1:VersionId>
        <d4p1:Workspace>String</d4p1:Workspace>
      </Schedule>
      <StopTime>0</StopTime>
    </RouteNode>
  </Nodes>
  <RealTime>0</RealTime>
  <RoundStartTimes>0</RoundStartTimes>
  <ShortestDistance>false</ShortestDistance>
  <StartClockAtFirstNode>false</StartClockAtFirstNode>
  <StartLocation xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
    <d2p1:x>0</d2p1:x>
    <d2p1:y>0</d2p1:y>
  </StartLocation>
  <StartTime>String</StartTime>
  <Time>0</Time>
  <TransitionTime>0</TransitionTime>
  <Workspace>String</Workspace>
</ProposeRouteRequest>