Field Squared API Services

<back to all web services

UserImport

Bulk import a set of users.

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

public class dtos
{

    /**
    * Bulk import a set of users.
    */
    public static class UserImport
    {
        public String Workspace = null;
        public ArrayList<User> Users = null;
        public String RequestId = null;
        
        public String getWorkspace() { return Workspace; }
        public UserImport setWorkspace(String value) { this.Workspace = value; return this; }
        public ArrayList<User> getUsers() { return Users; }
        public UserImport setUsers(ArrayList<User> value) { this.Users = value; return this; }
        public String getRequestId() { return RequestId; }
        public UserImport setRequestId(String value) { this.RequestId = value; return this; }
    }

    /**
    * Represents a DTO for a user in a workspace. Calls without an ObjectId will retrieve an array of all user objects for the workspace.
    */
    public static class User
    {
        public String Workspace = null;
        public String TimeZone = null;
        public String ObjectId = null;
        public String VersionId = null;
        public String Created = null;
        public String LastUpdated = null;
        public String BasedOn = null;
        public String ExternalId = null;
        public String Name = null;
        public String Initials = null;
        public String Phone = null;
        public String Email = null;
        public String Password = null;
        public String RequestUser = null;
        public Location Location = null;
        public String UserType = null;
        public ArrayList<Location> ProposedRoute = null;
        public ArrayList<Location> ActualRoute = null;
        public String Image = null;
        public UserStatus UserStatus = null;
        public String RecordStatus = null;
        public ArrayList<String> Documents = null;
        public Boolean SubscribeToEmails = null;
        public Address Address = null;
        public ArrayList<String> SkillTags = null;
        public Boolean Enabled = null;
        public ArrayList<String> UIPrefTaskColumnsOff = null;
        public ArrayList<UIColumnPref> UIPrefTaskColumns = null;
        public HashMap<String,String> Data = null;
        public ArrayList<String> Teams = null;
        public ArrayList<EventItem> Events = null;
        public String Color = null;
        public String VehicleAsset = null;
        public Boolean ExternalAuth = null;
        public String CreatedBy = null;
        public Boolean ServiceAccount = null;
        public ArrayList<String> Assets = null;
        public Boolean TfaRequired = null;
        public String TfaPreference = null;
        public ArrayList<WorkDay> WorkWeek = null;
        public Boolean CustomSchedulesEnabled = null;
        public ArrayList<CustomSchedule> CustomSchedules = null;
        public Boolean OverrideSso = null;
        
        public String getWorkspace() { return Workspace; }
        public User setWorkspace(String value) { this.Workspace = value; return this; }
        public String getTimeZone() { return TimeZone; }
        public User setTimeZone(String value) { this.TimeZone = value; return this; }
        public String getObjectId() { return ObjectId; }
        public User setObjectId(String value) { this.ObjectId = value; return this; }
        public String getVersionId() { return VersionId; }
        public User setVersionId(String value) { this.VersionId = value; return this; }
        public String getCreated() { return Created; }
        public User setCreated(String value) { this.Created = value; return this; }
        public String getLastUpdated() { return LastUpdated; }
        public User setLastUpdated(String value) { this.LastUpdated = value; return this; }
        public String getBasedOn() { return BasedOn; }
        public User setBasedOn(String value) { this.BasedOn = value; return this; }
        public String getExternalId() { return ExternalId; }
        public User setExternalId(String value) { this.ExternalId = value; return this; }
        public String getName() { return Name; }
        public User setName(String value) { this.Name = value; return this; }
        public String getInitials() { return Initials; }
        public User setInitials(String value) { this.Initials = value; return this; }
        public String getPhone() { return Phone; }
        public User setPhone(String value) { this.Phone = value; return this; }
        public String getEmail() { return Email; }
        public User setEmail(String value) { this.Email = value; return this; }
        public String getPassword() { return Password; }
        public User setPassword(String value) { this.Password = value; return this; }
        public String getRequestUser() { return RequestUser; }
        public User setRequestUser(String value) { this.RequestUser = value; return this; }
        public Location getLocation() { return Location; }
        public User setLocation(Location value) { this.Location = value; return this; }
        public String getUserType() { return UserType; }
        public User setUserType(String value) { this.UserType = value; return this; }
        public ArrayList<Location> getProposedRoute() { return ProposedRoute; }
        public User setProposedRoute(ArrayList<Location> value) { this.ProposedRoute = value; return this; }
        public ArrayList<Location> getActualRoute() { return ActualRoute; }
        public User setActualRoute(ArrayList<Location> value) { this.ActualRoute = value; return this; }
        public String getImage() { return Image; }
        public User setImage(String value) { this.Image = value; return this; }
        public UserStatus getUserStatus() { return UserStatus; }
        public User setUserStatus(UserStatus value) { this.UserStatus = value; return this; }
        public String getRecordStatus() { return RecordStatus; }
        public User setRecordStatus(String value) { this.RecordStatus = value; return this; }
        public ArrayList<String> getDocuments() { return Documents; }
        public User setDocuments(ArrayList<String> value) { this.Documents = value; return this; }
        public Boolean isSubscribeToEmails() { return SubscribeToEmails; }
        public User setSubscribeToEmails(Boolean value) { this.SubscribeToEmails = value; return this; }
        public Address getAddress() { return Address; }
        public User setAddress(Address value) { this.Address = value; return this; }
        public ArrayList<String> getSkillTags() { return SkillTags; }
        public User setSkillTags(ArrayList<String> value) { this.SkillTags = value; return this; }
        public Boolean isEnabled() { return Enabled; }
        public User setEnabled(Boolean value) { this.Enabled = value; return this; }
        public ArrayList<String> getUiPrefTaskColumnsOff() { return UIPrefTaskColumnsOff; }
        public User setUiPrefTaskColumnsOff(ArrayList<String> value) { this.UIPrefTaskColumnsOff = value; return this; }
        public ArrayList<UIColumnPref> getUiPrefTaskColumns() { return UIPrefTaskColumns; }
        public User setUiPrefTaskColumns(ArrayList<UIColumnPref> value) { this.UIPrefTaskColumns = value; return this; }
        public HashMap<String,String> getData() { return Data; }
        public User setData(HashMap<String,String> value) { this.Data = value; return this; }
        public ArrayList<String> getTeams() { return Teams; }
        public User setTeams(ArrayList<String> value) { this.Teams = value; return this; }
        public ArrayList<EventItem> getEvents() { return Events; }
        public User setEvents(ArrayList<EventItem> value) { this.Events = value; return this; }
        public String getColor() { return Color; }
        public User setColor(String value) { this.Color = value; return this; }
        public String getVehicleAsset() { return VehicleAsset; }
        public User setVehicleAsset(String value) { this.VehicleAsset = value; return this; }
        public Boolean isExternalAuth() { return ExternalAuth; }
        public User setExternalAuth(Boolean value) { this.ExternalAuth = value; return this; }
        public String getCreatedBy() { return CreatedBy; }
        public User setCreatedBy(String value) { this.CreatedBy = value; return this; }
        public Boolean isServiceAccount() { return ServiceAccount; }
        public User setServiceAccount(Boolean value) { this.ServiceAccount = value; return this; }
        public ArrayList<String> getAssets() { return Assets; }
        public User setAssets(ArrayList<String> value) { this.Assets = value; return this; }
        public Boolean isTfaRequired() { return TfaRequired; }
        public User setTfaRequired(Boolean value) { this.TfaRequired = value; return this; }
        public String getTfaPreference() { return TfaPreference; }
        public User setTfaPreference(String value) { this.TfaPreference = value; return this; }
        public ArrayList<WorkDay> getWorkWeek() { return WorkWeek; }
        public User setWorkWeek(ArrayList<WorkDay> value) { this.WorkWeek = value; return this; }
        public Boolean isCustomSchedulesEnabled() { return CustomSchedulesEnabled; }
        public User setCustomSchedulesEnabled(Boolean value) { this.CustomSchedulesEnabled = value; return this; }
        public ArrayList<CustomSchedule> getCustomSchedules() { return CustomSchedules; }
        public User setCustomSchedules(ArrayList<CustomSchedule> value) { this.CustomSchedules = value; return this; }
        public Boolean isOverrideSso() { return OverrideSso; }
        public User setOverrideSso(Boolean value) { this.OverrideSso = 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; }
    }

    public static enum UserStatus
    {
        NotStarted,
        Driving,
        InProgress,
        Complete,
        Blocked;
    }

    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 UIColumnPref
    {
        public String Name = null;
        public Double Width = null;
        
        public String getName() { return Name; }
        public UIColumnPref setName(String value) { this.Name = value; return this; }
        public Double getWidth() { return Width; }
        public UIColumnPref setWidth(Double value) { this.Width = value; return this; }
    }

    public static class EventItem
    {
        public String ObjectId = null;
        public String Date = null;
        public Location Location = null;
        public String Barcode = null;
        public String Details = null;
        public String Type = null;
        public Boolean IsScan = null;
        public String User = null;
        public String SelectedBy = null;
        public String Status = null;
        public String StatusType = null;
        public String DateCreated = null;
        public Boolean Automatic = null;
        
        public String getObjectId() { return ObjectId; }
        public EventItem setObjectId(String value) { this.ObjectId = value; return this; }
        public String getDate() { return Date; }
        public EventItem setDate(String value) { this.Date = value; return this; }
        public Location getLocation() { return Location; }
        public EventItem setLocation(Location value) { this.Location = value; return this; }
        public String getBarcode() { return Barcode; }
        public EventItem setBarcode(String value) { this.Barcode = value; return this; }
        public String getDetails() { return Details; }
        public EventItem setDetails(String value) { this.Details = value; return this; }
        public String getType() { return Type; }
        public EventItem setType(String value) { this.Type = value; return this; }
        public Boolean getIsScan() { return IsScan; }
        public EventItem setIsScan(Boolean value) { this.IsScan = value; return this; }
        public String getUser() { return User; }
        public EventItem setUser(String value) { this.User = value; return this; }
        public String getSelectedBy() { return SelectedBy; }
        public EventItem setSelectedBy(String value) { this.SelectedBy = value; return this; }
        public String getStatus() { return Status; }
        public EventItem setStatus(String value) { this.Status = value; return this; }
        public String getStatusType() { return StatusType; }
        public EventItem setStatusType(String value) { this.StatusType = value; return this; }
        public String getDateCreated() { return DateCreated; }
        public EventItem setDateCreated(String value) { this.DateCreated = value; return this; }
        public Boolean isAutomatic() { return Automatic; }
        public EventItem setAutomatic(Boolean value) { this.Automatic = value; return this; }
    }

    public static class WorkDay
    {
        public Integer DayOfWeek = null;
        public Integer Start = null;
        public Integer End = null;
        public Integer Lunch = null;
        
        public Integer getDayOfWeek() { return DayOfWeek; }
        public WorkDay setDayOfWeek(Integer value) { this.DayOfWeek = value; return this; }
        public Integer getStart() { return Start; }
        public WorkDay setStart(Integer value) { this.Start = value; return this; }
        public Integer getEnd() { return End; }
        public WorkDay setEnd(Integer value) { this.End = value; return this; }
        public Integer getLunch() { return Lunch; }
        public WorkDay setLunch(Integer value) { this.Lunch = value; return this; }
    }

    public static class CustomSchedule
    {
        public String Date = null;
        public Integer Start = null;
        public Integer End = null;
        public String Type = null;
        
        public String getDate() { return Date; }
        public CustomSchedule setDate(String value) { this.Date = value; return this; }
        public Integer getStart() { return Start; }
        public CustomSchedule setStart(Integer value) { this.Start = value; return this; }
        public Integer getEnd() { return End; }
        public CustomSchedule setEnd(Integer value) { this.End = value; return this; }
        public String getType() { return Type; }
        public CustomSchedule setType(String value) { this.Type = value; return this; }
    }

}

Java UserImport 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}/UserImport HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Workspace: String,
	Users: 
	[
		{
			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
		}
	],
	RequestId: String
}