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}
Track Parameters:
NameParameterData TypeRequiredDescription
WorkspacepathstringNo
UserIdpathstringNo
TrackIdbodystringNo
ItemsbodyList<string>No
StopsbodyList<StopItem>No
SpdbodyList<RedlineItem>No
AddressbodyAddressNo
DistancebodydoubleNo
StopItem Parameters:
NameParameterData TypeRequiredDescription
PTformstringNo
IntformintNo
RedlineItem Parameters:
NameParameterData TypeRequiredDescription
PTformstringNo
IntformintNo
AvgformdoubleNo
Address Parameters:
NameParameterData TypeRequiredDescription
StreetformstringNo
UnitformstringNo
CityformstringNo
StateformstringNo
ZipformstringNo
ContactTitleformstringNo
ContactNameformstringNo
ContactPhoneformstringNo
ContactEmailformstringNo
LocationformLocationNo
SiteNameformstringNo
GeocodeFailedformboolNo
CountryformstringNo
Location Parameters:
NameParameterData TypeRequiredDescription
yformdoubleNo
xformdoubleNo

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

HTTP + XML

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

<Track xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Tracks">
  <Address xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
    <d2p1:City>String</d2p1:City>
    <d2p1:ContactEmail>String</d2p1:ContactEmail>
    <d2p1:ContactName>String</d2p1:ContactName>
    <d2p1:ContactPhone>String</d2p1:ContactPhone>
    <d2p1:ContactTitle>String</d2p1:ContactTitle>
    <d2p1:Country>String</d2p1:Country>
    <d2p1:GeocodeFailed>false</d2p1:GeocodeFailed>
    <d2p1:Location>
      <d2p1:x>0</d2p1:x>
      <d2p1:y>0</d2p1:y>
    </d2p1:Location>
    <d2p1:SiteName>String</d2p1:SiteName>
    <d2p1:State>String</d2p1:State>
    <d2p1:Street>String</d2p1:Street>
    <d2p1:Unit>String</d2p1:Unit>
    <d2p1:Zip>String</d2p1:Zip>
  </Address>
  <Distance>0</Distance>
  <Items xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </Items>
  <Spd>
    <RedlineItem>
      <Avg>0</Avg>
      <Int>0</Int>
      <PT>String</PT>
    </RedlineItem>
  </Spd>
  <Stops>
    <StopItem>
      <Int>0</Int>
      <PT>String</PT>
    </StopItem>
  </Stops>
  <TrackId>String</TrackId>
  <UserId>String</UserId>
  <Workspace>String</Workspace>
</Track>