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 .jsv suffix or ?format=jsv

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Workspace: String,
	TimeZone: String,
	ObjectId: String,
	VersionId: String,
	Created: String,
	LastUpdated: String,
	BasedOn: String,
	ExternalId: String,
	Name: String,
	Initials: String,
	Phone: String,
	Email: String,
	Password: String,
	RequestUser: String,
	Location: 
	{
		y: 0,
		x: 0
	},
	UserType: String,
	ProposedRoute: 
	[
		{
			y: 0,
			x: 0
		}
	],
	ActualRoute: 
	[
		{
			y: 0,
			x: 0
		}
	],
	Image: String,
	UserStatus: NotStarted,
	RecordStatus: String,
	Documents: 
	[
		String
	],
	SubscribeToEmails: False,
	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
	},
	SkillTags: 
	[
		String
	],
	Enabled: False,
	UIPrefTaskColumnsOff: 
	[
		String
	],
	UIPrefTaskColumns: 
	[
		{
			Name: String,
			Width: 0
		}
	],
	Data: 
	{
		String: String
	},
	Teams: 
	[
		String
	],
	Events: 
	[
		{
			ObjectId: String,
			Date: String,
			Location: 
			{
				y: 0,
				x: 0
			},
			Barcode: String,
			Details: String,
			Type: String,
			IsScan: False,
			User: String,
			SelectedBy: String,
			Status: String,
			StatusType: String,
			DateCreated: String,
			Automatic: False
		}
	],
	Color: String,
	VehicleAsset: String,
	ExternalAuth: False,
	CreatedBy: String,
	ServiceAccount: False,
	Assets: 
	[
		String
	],
	TfaRequired: False,
	TfaPreference: String,
	WorkWeek: 
	[
		{
			DayOfWeek: 0,
			Start: 0,
			End: 0,
			Lunch: 0
		}
	],
	CustomSchedulesEnabled: False,
	CustomSchedules: 
	[
		{
			Date: String,
			Start: 0,
			End: 0,
			Type: String
		}
	],
	OverrideSso: False
}