| POST | /{Workspace}/Track/{UserId} |
|---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Field2Office.API.Model.Tracks
Imports Field2Office.API.Model
Namespace Global
Namespace Field2Office.API.Model
Public Partial Class Address
Public Overridable Property Street As String
Public Overridable Property Unit As String
Public Overridable Property City As String
Public Overridable Property State As String
Public Overridable Property Zip As String
Public Overridable Property ContactTitle As String
Public Overridable Property ContactName As String
Public Overridable Property ContactPhone As String
Public Overridable Property ContactEmail As String
Public Overridable Property Location As Location
Public Overridable Property SiteName As String
Public Overridable Property GeocodeFailed As Boolean
Public Overridable Property Country As String
End Class
Public Partial Class Location
Public Overridable Property y As Double
Public Overridable Property x As Double
End Class
End Namespace
Namespace Field2Office.API.Model.Tracks
'''<Summary>
'''Service representing a RedlineItem object in a workspace.
'''</Summary>
Public Partial Class RedlineItem
Public Overridable Property PT As String
Public Overridable Property Int As Integer
Public Overridable Property Avg As Double
End Class
'''<Summary>
'''Service representing a StopItem object in a workspace.
'''</Summary>
Public Partial Class StopItem
Public Overridable Property PT As String
Public Overridable Property Int As Integer
End Class
'''<Summary>
'''Service representing a Track object in a workspace. Note that request.TrackId is returned on successful POST else null. The Items property is a list of Item objects, each object representing a location where the user stopped for a period of time. The Item object is comprised of a Location property (Lat/Lon), Time property (Timestamp in UTC string format) and Interval Property (Time stopped in seconds). The RedlineItems property is a list of RedlineItem objects, each object representing a location where the user began exceeding the redline speed defined in the workspace for a period of time also defined in the workspace. The properties are identical to the StopItem object, however the Interval property represents time spent above the redline speed in seconds. Speed property is in meters per sec.
'''</Summary>
Public Partial Class Track
Public Sub New()
Items = New List(Of String)
Stops = New List(Of StopItem)
Spd = New List(Of RedlineItem)
End Sub
Public Overridable Property Workspace As String
Public Overridable Property UserId As String
Public Overridable Property TrackId As String
Public Overridable Property Items As List(Of String)
Public Overridable Property Stops As List(Of StopItem)
Public Overridable Property Spd As List(Of RedlineItem)
Public Overridable Property Address As Address
Public Overridable Property Distance As Double
End Class
End Namespace
End Namespace
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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /{Workspace}/Track/{UserId} HTTP/1.1
Host: dev.fieldsquared.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Workspace":"String","UserId":"String","TrackId":"String","Items":["String"],"Stops":[{"PT":"String","Int":0}],"Spd":[{"PT":"String","Int":0,"Avg":0}],"Address":{"Street":"String","Unit":"String","City":"String","State":"String","Zip":"String","ContactTitle":"String","ContactName":"String","ContactPhone":"String","ContactEmail":"String","Location":{"y":0,"x":0},"SiteName":"String","GeocodeFailed":false,"Country":"String"},"Distance":0}