| POST | /{Workspace}/Track/{UserId} |
|---|
namespace Field2Office.API.Model
open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
///<summary>
///Service representing a StopItem object in a workspace.
///</summary>
[<AllowNullLiteral>]
type StopItem() =
member val PT:String = null with get,set
member val Int:Int32 = new Int32() with get,set
///<summary>
///Service representing a RedlineItem object in a workspace.
///</summary>
[<AllowNullLiteral>]
type RedlineItem() =
member val PT:String = null with get,set
member val Int:Int32 = new Int32() with get,set
member val Avg:Double = new Double() with get,set
[<AllowNullLiteral>]
type Location() =
member val y:Double = new Double() with get,set
member val x:Double = new Double() with get,set
[<AllowNullLiteral>]
type Address() =
member val Street:String = null with get,set
member val Unit:String = null with get,set
member val City:String = null with get,set
member val State:String = null with get,set
member val Zip:String = null with get,set
member val ContactTitle:String = null with get,set
member val ContactName:String = null with get,set
member val ContactPhone:String = null with get,set
member val ContactEmail:String = null with get,set
member val Location:Location = null with get,set
member val SiteName:String = null with get,set
member val GeocodeFailed:Boolean = new Boolean() with get,set
member val Country:String = null with get,set
///<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>
[<AllowNullLiteral>]
type Track() =
member val Workspace:String = null with get,set
member val UserId:String = null with get,set
member val TrackId:String = null with get,set
member val Items:ResizeArray<String> = new ResizeArray<String>() with get,set
member val Stops:ResizeArray<StopItem> = new ResizeArray<StopItem>() with get,set
member val Spd:ResizeArray<RedlineItem> = new ResizeArray<RedlineItem>() with get,set
member val Address:Address = null with get,set
member val Distance:Double = new Double() with get,set
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}