Field Squared API Services

<back to all web services

ProposeRouteRequest

The following routes are available for this service:
POST/{Workspace}/ProposeRoute

export class ClassedItem
{
    public ObjectId: string;
    public Class: string;
    public VersionId: string;
    public Ancestors: string[];
    public Type: string;

    public constructor(init?: Partial<ClassedItem>) { (Object as any).assign(this, init); }
}

export class Location
{
    public y: number;
    public x: number;

    public constructor(init?: Partial<Location>) { (Object as any).assign(this, init); }
}

export class Schedule
{
    public Workspace: string;
    public ObjectId: string;
    public VersionId: string;
    public BasedOn: string;
    public Start: string;
    public End: string;
    public TimeZone: string;
    public Users: string[];
    public Teams: string[];
    public Data: { [index: string]: Object; };

    public constructor(init?: Partial<Schedule>) { (Object as any).assign(this, init); }
}

export class RouteNode extends ClassedItem
{
    public Location: Location;
    public StopTime: number;
    public Schedule: Schedule;
    public Name: string;

    public constructor(init?: Partial<RouteNode>) { super(init); (Object as any).assign(this, init); }
}

export class ProposeRouteRequest
{
    public Workspace: string;
    public Nodes: RouteNode[];
    public AllowReorder: boolean;
    public StartLocation: Location;
    public EndLocation: Location;
    public ShortestDistance: boolean;
    public StartTime: string;
    public StartClockAtFirstNode: boolean;
    public RoundStartTimes: number;
    public TransitionTime: number;
    public LunchStart: string;
    public LunchDuration: number;
    public Time: number;
    public RealTime: number;
    public Distance: number;

    public constructor(init?: Partial<ProposeRouteRequest>) { (Object as any).assign(this, init); }
}

TypeScript ProposeRouteRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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/json
Content-Type: application/json
Content-Length: length

{"Workspace":"String","Nodes":[{"Location":{"y":0,"x":0},"StopTime":0,"Schedule":{"Workspace":"String","ObjectId":"String","VersionId":"String","BasedOn":"String","Start":"String","End":"String","TimeZone":"String","Users":["String"],"Teams":["String"],"Data":{"String":{}}},"Name":"String","ObjectId":"String","Class":"String","VersionId":"String","Ancestors":["String"],"Type":"String"}],"AllowReorder":false,"StartLocation":{"y":0,"x":0},"EndLocation":{"y":0,"x":0},"ShortestDistance":false,"StartTime":"String","StartClockAtFirstNode":false,"RoundStartTimes":0,"TransitionTime":0,"LunchStart":"String","LunchDuration":0,"Time":0,"RealTime":0,"Distance":0}