| POST | /{Workspace}/UserImport |
|---|
export class Location
{
public y: number;
public x: number;
public constructor(init?: Partial<Location>) { (Object as any).assign(this, init); }
}
export enum UserStatus
{
NotStarted = 'NotStarted',
Driving = 'Driving',
InProgress = 'InProgress',
Complete = 'Complete',
Blocked = 'Blocked',
}
export class Address
{
public Street: string;
public Unit: string;
public City: string;
public State: string;
public Zip: string;
public ContactTitle: string;
public ContactName: string;
public ContactPhone: string;
public ContactEmail: string;
public Location: Location;
public SiteName: string;
public GeocodeFailed: boolean;
public Country: string;
public constructor(init?: Partial<Address>) { (Object as any).assign(this, init); }
}
export class UIColumnPref
{
public Name: string;
public Width: number;
public constructor(init?: Partial<UIColumnPref>) { (Object as any).assign(this, init); }
}
export class EventItem
{
public ObjectId: string;
public Date: string;
public Location: Location;
public Barcode: string;
public Details: string;
public Type: string;
public IsScan: boolean;
public User: string;
public SelectedBy: string;
public Status: string;
public StatusType: string;
public DateCreated: string;
public Automatic: boolean;
public constructor(init?: Partial<EventItem>) { (Object as any).assign(this, init); }
}
export class WorkDay
{
public DayOfWeek: number;
public Start: number;
public End: number;
public Lunch: number;
public constructor(init?: Partial<WorkDay>) { (Object as any).assign(this, init); }
}
export class CustomSchedule
{
public Date: string;
public Start: number;
public End: number;
public Type: string;
public constructor(init?: Partial<CustomSchedule>) { (Object as any).assign(this, init); }
}
/** @description Represents a DTO for a user in a workspace. Calls without an ObjectId will retrieve an array of all user objects for the workspace. */
export class User
{
public Workspace: string;
public TimeZone: string;
public ObjectId: string;
public VersionId: string;
public Created: string;
public LastUpdated: string;
public BasedOn: string;
public ExternalId: string;
public Name: string;
public Initials: string;
public Phone: string;
public Email: string;
public Password: string;
public RequestUser: string;
public Location: Location;
public UserType: string;
public ProposedRoute: Location[];
public ActualRoute: Location[];
public Image: string;
public UserStatus: UserStatus;
public RecordStatus: string;
public Documents: string[];
public SubscribeToEmails: boolean;
public Address: Address;
public SkillTags: string[];
public Enabled: boolean;
public UIPrefTaskColumnsOff: string[];
public UIPrefTaskColumns: UIColumnPref[];
public Data: { [index: string]: string; };
public Teams: string[];
public Events: EventItem[];
public Color: string;
public VehicleAsset: string;
public ExternalAuth: boolean;
public CreatedBy: string;
public ServiceAccount: boolean;
public Assets: string[];
public TfaRequired: boolean;
public TfaPreference: string;
public WorkWeek: WorkDay[];
public CustomSchedulesEnabled: boolean;
public CustomSchedules: CustomSchedule[];
public OverrideSso: boolean;
public constructor(init?: Partial<User>) { (Object as any).assign(this, init); }
}
/** @description Bulk import a set of users. */
export class UserImport
{
public Workspace: string;
public Users: User[];
public RequestId: string;
public constructor(init?: Partial<UserImport>) { (Object as any).assign(this, init); }
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=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
}