Field Squared API Services

<back to all web services

Team

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

The following routes are available for this service:
GET,POST,PUT,DELETE/{Workspace}/Team/{ObjectId}
GET/{Workspace}/Team

export class DomainItem
{
    public Workspace: string;
    public ObjectId: string;
    public VersionId: string;
    public LastUpdated: string;

    public constructor(init?: Partial<DomainItem>) { (Object as any).assign(this, init); }
}

export class Location
{
    public y: number;
    public x: number;

    public constructor(init?: Partial<Location>) { (Object as any).assign(this, init); }
}

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 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); }
}

/** @description Represents a DTO for a team in a workspace. Calls without an ObjectId will retrieve an array of all team objects for the workspace. */
export class Team
{
    public Workspace: string;
    public TimeZone: string;
    public ObjectId: string;
    public ExternalId: string;
    public VersionId: string;
    public BasedOn: string;
    public Name: string;
    public Enabled: boolean;
    public Members: DomainItem[];
    public Lead: DomainItem;
    public Parent: DomainItem;
    public Address: Address;
    public Data: { [index: string]: string; };
    public Teams: string[];
    public Events: EventItem[];
    public CreatedBy: string;
    public ActiveLaborTypes: { [index: string]: Object; };

    public constructor(init?: Partial<Team>) { (Object as any).assign(this, init); }
}

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

{
	Workspace: String,
	TimeZone: String,
	ObjectId: String,
	ExternalId: String,
	VersionId: String,
	BasedOn: String,
	Name: String,
	Enabled: False,
	Members: 
	[
		{
			Workspace: String,
			ObjectId: String,
			VersionId: String,
			LastUpdated: String
		}
	],
	Lead: 
	{
		Workspace: String,
		ObjectId: String,
		VersionId: String,
		LastUpdated: String
	},
	Parent: 
	{
		Workspace: String,
		ObjectId: String,
		VersionId: String,
		LastUpdated: String
	},
	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
	},
	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
		}
	],
	CreatedBy: String,
	ActiveLaborTypes: 
	{
		String: {}
	}
}