Field Squared API Services

<back to all web services

ProposeRouteRequest

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

Namespace Global

    Namespace Field2Office.API.Model

        Public Partial Class Location
            Public Overridable Property y As Double
            Public Overridable Property x As Double
        End Class
    End Namespace

    Namespace Field2Office.API.Model.MapRoute

        Public Partial Class ProposeRouteRequest
            Public Sub New()
                Nodes = New List(Of RouteNode)
            End Sub

            Public Overridable Property Workspace As String
            Public Overridable Property Nodes As List(Of RouteNode)
            Public Overridable Property AllowReorder As Boolean
            Public Overridable Property StartLocation As Location
            Public Overridable Property EndLocation As Location
            Public Overridable Property ShortestDistance As Boolean
            Public Overridable Property StartTime As String
            Public Overridable Property StartClockAtFirstNode As Boolean
            Public Overridable Property RoundStartTimes As Integer
            Public Overridable Property TransitionTime As Integer
            Public Overridable Property LunchStart As String
            Public Overridable Property LunchDuration As Integer
            Public Overridable Property Time As Integer
            Public Overridable Property RealTime As Integer
            Public Overridable Property Distance As Double
        End Class

        Public Partial Class RouteNode
            Inherits ClassedItem
            Public Overridable Property Location As Location
            Public Overridable Property StopTime As Integer
            Public Overridable Property Schedule As Schedule
            Public Overridable Property Name As String
        End Class
    End Namespace

    Namespace Field2Office.API.Model.Schedules

        Public Partial Class Schedule
            Public Sub New()
                Users = New List(Of String)
                Teams = New List(Of String)
                Data = New Dictionary(Of String, Object)
            End Sub

            Public Overridable Property Workspace As String
            Public Overridable Property ObjectId As String
            Public Overridable Property VersionId As String
            Public Overridable Property BasedOn As String
            Public Overridable Property Start As String
            Public Overridable Property [End] As String
            Public Overridable Property TimeZone As String
            Public Overridable Property Users As List(Of String)
            Public Overridable Property Teams As List(Of String)
            Public Overridable Property Data As Dictionary(Of String, Object)
        End Class
    End Namespace

    Namespace Field2Office.DomainObjects.Model

        Public Partial Class ClassedItem
            Public Sub New()
                Ancestors = New List(Of String)
            End Sub

            Public Overridable Property ObjectId As String
            Public Overridable Property [Class] As String
            Public Overridable Property VersionId As String
            Public Overridable Property Ancestors As List(Of String)
            Public Overridable Property Type As String
        End Class
    End Namespace
End Namespace

VB.NET 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}