Field Squared API Services

<back to all web services

Track

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.

The following routes are available for this service:
POST/{Workspace}/Track/{UserId}
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    /**
    * 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.
    */
    public static class Track
    {
        public String Workspace = null;
        public String UserId = null;
        public String TrackId = null;
        public ArrayList<String> Items = null;
        public ArrayList<StopItem> Stops = null;
        public ArrayList<RedlineItem> Spd = null;
        public Address Address = null;
        public Double Distance = null;
        
        public String getWorkspace() { return Workspace; }
        public Track setWorkspace(String value) { this.Workspace = value; return this; }
        public String getUserId() { return UserId; }
        public Track setUserId(String value) { this.UserId = value; return this; }
        public String getTrackId() { return TrackId; }
        public Track setTrackId(String value) { this.TrackId = value; return this; }
        public ArrayList<String> getItems() { return Items; }
        public Track setItems(ArrayList<String> value) { this.Items = value; return this; }
        public ArrayList<StopItem> getStops() { return Stops; }
        public Track setStops(ArrayList<StopItem> value) { this.Stops = value; return this; }
        public ArrayList<RedlineItem> getSpd() { return Spd; }
        public Track setSpd(ArrayList<RedlineItem> value) { this.Spd = value; return this; }
        public Address getAddress() { return Address; }
        public Track setAddress(Address value) { this.Address = value; return this; }
        public Double getDistance() { return Distance; }
        public Track setDistance(Double value) { this.Distance = value; return this; }
    }

    /**
    * Service representing a StopItem object in a workspace.
    */
    public static class StopItem
    {
        public String PT = null;
        public Integer Int = null;
        
        public String getPt() { return PT; }
        public StopItem setPt(String value) { this.PT = value; return this; }
        public Integer getInt() { return Int; }
        public StopItem setInt(Integer value) { this.Int = value; return this; }
    }

    /**
    * Service representing a RedlineItem object in a workspace.
    */
    public static class RedlineItem
    {
        public String PT = null;
        public Integer Int = null;
        public Double Avg = null;
        
        public String getPt() { return PT; }
        public RedlineItem setPt(String value) { this.PT = value; return this; }
        public Integer getInt() { return Int; }
        public RedlineItem setInt(Integer value) { this.Int = value; return this; }
        public Double getAvg() { return Avg; }
        public RedlineItem setAvg(Double value) { this.Avg = value; return this; }
    }

    public static class Address
    {
        public String Street = null;
        public String Unit = null;
        public String City = null;
        public String State = null;
        public String Zip = null;
        public String ContactTitle = null;
        public String ContactName = null;
        public String ContactPhone = null;
        public String ContactEmail = null;
        public Location Location = null;
        public String SiteName = null;
        public Boolean GeocodeFailed = null;
        public String Country = null;
        
        public String getStreet() { return Street; }
        public Address setStreet(String value) { this.Street = value; return this; }
        public String getUnit() { return Unit; }
        public Address setUnit(String value) { this.Unit = value; return this; }
        public String getCity() { return City; }
        public Address setCity(String value) { this.City = value; return this; }
        public String getState() { return State; }
        public Address setState(String value) { this.State = value; return this; }
        public String getZip() { return Zip; }
        public Address setZip(String value) { this.Zip = value; return this; }
        public String getContactTitle() { return ContactTitle; }
        public Address setContactTitle(String value) { this.ContactTitle = value; return this; }
        public String getContactName() { return ContactName; }
        public Address setContactName(String value) { this.ContactName = value; return this; }
        public String getContactPhone() { return ContactPhone; }
        public Address setContactPhone(String value) { this.ContactPhone = value; return this; }
        public String getContactEmail() { return ContactEmail; }
        public Address setContactEmail(String value) { this.ContactEmail = value; return this; }
        public Location getLocation() { return Location; }
        public Address setLocation(Location value) { this.Location = value; return this; }
        public String getSiteName() { return SiteName; }
        public Address setSiteName(String value) { this.SiteName = value; return this; }
        public Boolean isGeocodeFailed() { return GeocodeFailed; }
        public Address setGeocodeFailed(Boolean value) { this.GeocodeFailed = value; return this; }
        public String getCountry() { return Country; }
        public Address setCountry(String value) { this.Country = value; return this; }
    }

    public static class Location
    {
        public Double y = null;
        public Double x = null;
        
        public Double getY() { return y; }
        public Location setY(Double value) { this.y = value; return this; }
        public Double getX() { return x; }
        public Location setX(Double value) { this.x = value; return this; }
    }

}

Java Track 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}/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}