Field Squared API Services

<back to all web services

PublicUser

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


@DataContract
open class PublicUser
{
    @DataMember
    var Id:String? = null

    @DataMember
    var Workspace:String? = null

    @DataMember
    var User:User? = null

    @DataMember
    var Users:ArrayList<User> = ArrayList<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.
*/
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 PublicUser 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}/API/User/{Id} HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Id":"String","Workspace":"String","User":{"ExternalId":"String","Name":"String","Initials":"String","Phone":"String","Email":"String","UserType":"String","Image":"String","Lat":0,"Lon":0,"StreetAddress":"String","Unit":"String","City":"String","State":"String","Zip":"String","Country":"String","SkillTags":["String"],"Enabled":false,"Data":{"String":{}},"Teams":["String"],"LastUpdated":"String","Created":"String"},"Users":[{"ExternalId":"String","Name":"String","Initials":"String","Phone":"String","Email":"String","UserType":"String","Image":"String","Lat":0,"Lon":0,"StreetAddress":"String","Unit":"String","City":"String","State":"String","Zip":"String","Country":"String","SkillTags":["String"],"Enabled":false,"Data":{"String":{}},"Teams":["String"],"LastUpdated":"String","Created":"String"}]}