Field Squared API Services

<back to all web services

User

Represents a DTO for a user in a workspace. Calls without an ObjectId will retrieve an array of all user objects for the workspace.

The following routes are available for this service:
GET,POST,PUT,DELETE/{Workspace}/User/{ObjectId}
GET/{Workspace}/User
import java.math.*
import java.util.*
import net.servicestack.client.*


/**
* Represents a DTO for a user in a workspace. Calls without an ObjectId will retrieve an array of all user objects for the workspace.
*/
open class User
{
    var Workspace:String? = null
    var TimeZone:String? = null
    var ObjectId:String? = null
    var VersionId:String? = null
    var Created:String? = null
    var LastUpdated:String? = null
    var BasedOn:String? = null
    var ExternalId:String? = null
    var Name:String? = null
    var Initials:String? = null
    var Phone:String? = null
    var Email:String? = null
    var Password:String? = null
    var RequestUser:String? = null
    var Location:Location? = null
    var UserType:String? = null
    var ProposedRoute:ArrayList<Location> = ArrayList<Location>()
    var ActualRoute:ArrayList<Location> = ArrayList<Location>()
    var Image:String? = null
    var UserStatus:UserStatus? = null
    var RecordStatus:String? = null
    var Documents:ArrayList<String> = ArrayList<String>()
    var SubscribeToEmails:Boolean? = null
    var Address:Address? = null
    var SkillTags:ArrayList<String> = ArrayList<String>()
    var Enabled:Boolean? = null
    var UIPrefTaskColumnsOff:ArrayList<String> = ArrayList<String>()
    var UIPrefTaskColumns:ArrayList<UIColumnPref> = ArrayList<UIColumnPref>()
    var Data:HashMap<String,String> = HashMap<String,String>()
    var Teams:ArrayList<String> = ArrayList<String>()
    var Events:ArrayList<EventItem> = ArrayList<EventItem>()
    var Color:String? = null
    var VehicleAsset:String? = null
    var ExternalAuth:Boolean? = null
    var CreatedBy:String? = null
    var ServiceAccount:Boolean? = null
    var Assets:ArrayList<String> = ArrayList<String>()
    var TfaRequired:Boolean? = null
    var TfaPreference:String? = null
    var WorkWeek:ArrayList<WorkDay> = ArrayList<WorkDay>()
    var CustomSchedulesEnabled:Boolean? = null
    var CustomSchedules:ArrayList<CustomSchedule> = ArrayList<CustomSchedule>()
    var OverrideSso:Boolean? = null
}

open class Location
{
    var y:Double? = null
    var x:Double? = null
}

enum class UserStatus
{
    NotStarted,
    Driving,
    InProgress,
    Complete,
    Blocked,
}

open class Address
{
    var Street:String? = null
    var Unit:String? = null
    var City:String? = null
    var State:String? = null
    var Zip:String? = null
    var ContactTitle:String? = null
    var ContactName:String? = null
    var ContactPhone:String? = null
    var ContactEmail:String? = null
    var Location:Location? = null
    var SiteName:String? = null
    var GeocodeFailed:Boolean? = null
    var Country:String? = null
}

open class UIColumnPref
{
    var Name:String? = null
    var Width:Double? = null
}

open class EventItem
{
    var ObjectId:String? = null
    var Date:String? = null
    var Location:Location? = null
    var Barcode:String? = null
    var Details:String? = null
    var Type:String? = null
    var IsScan:Boolean? = null
    var User:String? = null
    var SelectedBy:String? = null
    var Status:String? = null
    var StatusType:String? = null
    var DateCreated:String? = null
    var Automatic:Boolean? = null
}

open class WorkDay
{
    var DayOfWeek:Int? = null
    var Start:Int? = null
    var End:Int? = null
    var Lunch:Int? = null
}

open class CustomSchedule
{
    var Date:String? = null
    var Start:Int? = null
    var End:Int? = null
    var Type:String? = null
}

Kotlin User DTOs

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}/User/{ObjectId} HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<User xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Users">
  <ActualRoute xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
    <d2p1:Location>
      <d2p1:x>0</d2p1:x>
      <d2p1:y>0</d2p1:y>
    </d2p1:Location>
  </ActualRoute>
  <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>
  <Assets xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </Assets>
  <BasedOn>String</BasedOn>
  <Color>String</Color>
  <Created>String</Created>
  <CreatedBy>String</CreatedBy>
  <CustomSchedules>
    <CustomSchedule>
      <Date>String</Date>
      <End>0</End>
      <Start>0</Start>
      <Type>String</Type>
    </CustomSchedule>
  </CustomSchedules>
  <CustomSchedulesEnabled>false</CustomSchedulesEnabled>
  <Data xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Data>
  <Documents xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </Documents>
  <Email>String</Email>
  <Enabled>false</Enabled>
  <Events xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
    <d2p1:EventItem>
      <d2p1:Automatic>false</d2p1:Automatic>
      <d2p1:Barcode>String</d2p1:Barcode>
      <d2p1:Date>String</d2p1:Date>
      <d2p1:DateCreated>String</d2p1:DateCreated>
      <d2p1:Details>String</d2p1:Details>
      <d2p1:IsScan>false</d2p1:IsScan>
      <d2p1:Location>
        <d2p1:x>0</d2p1:x>
        <d2p1:y>0</d2p1:y>
      </d2p1:Location>
      <d2p1:ObjectId>String</d2p1:ObjectId>
      <d2p1:SelectedBy>String</d2p1:SelectedBy>
      <d2p1:Status>String</d2p1:Status>
      <d2p1:StatusType>String</d2p1:StatusType>
      <d2p1:Type>String</d2p1:Type>
      <d2p1:User>String</d2p1:User>
    </d2p1:EventItem>
  </Events>
  <ExternalAuth>false</ExternalAuth>
  <ExternalId>String</ExternalId>
  <Image>String</Image>
  <Initials>String</Initials>
  <LastUpdated>String</LastUpdated>
  <Location xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
    <d2p1:x>0</d2p1:x>
    <d2p1:y>0</d2p1:y>
  </Location>
  <Name>String</Name>
  <ObjectId>String</ObjectId>
  <OverrideSso>false</OverrideSso>
  <Password>String</Password>
  <Phone>String</Phone>
  <ProposedRoute xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
    <d2p1:Location>
      <d2p1:x>0</d2p1:x>
      <d2p1:y>0</d2p1:y>
    </d2p1:Location>
  </ProposedRoute>
  <RecordStatus>String</RecordStatus>
  <RequestUser>String</RequestUser>
  <ServiceAccount>false</ServiceAccount>
  <SkillTags xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </SkillTags>
  <SubscribeToEmails>false</SubscribeToEmails>
  <Teams xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </Teams>
  <TfaPreference>String</TfaPreference>
  <TfaRequired>false</TfaRequired>
  <TimeZone>String</TimeZone>
  <UIPrefTaskColumns xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
    <d2p1:UIColumnPref>
      <d2p1:Name>String</d2p1:Name>
      <d2p1:Width>0</d2p1:Width>
    </d2p1:UIColumnPref>
  </UIPrefTaskColumns>
  <UIPrefTaskColumnsOff xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </UIPrefTaskColumnsOff>
  <UserStatus>NotStarted</UserStatus>
  <UserType>String</UserType>
  <VehicleAsset>String</VehicleAsset>
  <VersionId>String</VersionId>
  <WorkWeek xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Workspaces">
    <d2p1:WorkDay>
      <d2p1:DayOfWeek>0</d2p1:DayOfWeek>
      <d2p1:End>0</d2p1:End>
      <d2p1:Lunch>0</d2p1:Lunch>
      <d2p1:Start>0</d2p1:Start>
    </d2p1:WorkDay>
  </WorkWeek>
  <Workspace>String</Workspace>
</User>