Field Squared API Services

<back to all web services

AssetType

Represents a single asset type
.

The following routes are available for this service:
GET,POST,DELETE/{Workspace}/AssetType/{Type}
GET/{Workspace}/AssetType

export enum CustomFieldDataType
{
    Text = 'Text',
    Number = 'Number',
    Decimal = 'Decimal',
    Money = 'Money',
    PhoneNumber = 'PhoneNumber',
    Ssn = 'Ssn',
    List = 'List',
    Date = 'Date',
    File = 'File',
    Barcode = 'Barcode',
    GPS = 'GPS',
    Photo = 'Photo',
    Spacer = 'Spacer',
    Separator = 'Separator',
    AutoNumber = 'AutoNumber',
    TextArea = 'TextArea',
    Contact = 'Contact',
    User = 'User',
    Asset = 'Asset',
    Checkbox = 'Checkbox',
    CoreAssetList = 'CoreAssetList',
    CoreTaskList = 'CoreTaskList',
    CoreParentTask = 'CoreParentTask',
    CoreContactList = 'CoreContactList',
    ComboBox = 'ComboBox',
    DateTime = 'DateTime',
    Time = 'Time',
    Location = 'Location',
    CoreLocation = 'CoreLocation',
    Label = 'Label',
    EventLog = 'EventLog',
    Address = 'Address',
    Catalog = 'Catalog',
    CoreTeamList = 'CoreTeamList',
    Segment = 'Segment',
    CoreTimeSeries = 'CoreTimeSeries',
    TimeSeries = 'TimeSeries',
    Command = 'Command',
    AutoNumberNumeric = 'AutoNumberNumeric',
    CatalogList = 'CatalogList',
    CatalogComboBox = 'CatalogComboBox',
    DateRange = 'DateRange',
    DocumentGrid = 'DocumentGrid',
    ReportLink = 'ReportLink',
    Hyperlink = 'Hyperlink',
    PercentComplete = 'PercentComplete',
    Chart = 'Chart',
    Range = 'Range',
    ExternalId = 'ExternalId',
    AssetCatalog = 'AssetCatalog',
    Inventory = 'Inventory',
    CoreTaskLaborItemTypes = 'CoreTaskLaborItemTypes',
    CoreTaskLaborItems = 'CoreTaskLaborItems',
    ObjectList = 'ObjectList',
    CoreTimeZone = 'CoreTimeZone',
}

export class CustomField
{
    public Key: string;
    public Label: string;
    public IsActive: boolean;
    public IsReadOnly: boolean;
    public IsHidden: boolean;
    public IsMandatory: boolean;
    public DisplayOnMap: boolean;
    public CustomFieldDataType: CustomFieldDataType;
    public Values: string;
    public Prompt: string;
    public Default: string;
    public DefaultAutoUpdate: boolean;
    public RequiredIf: string;
    public Hidden: string[];
    public ReadOnly: string[];
    public ControlArgs: { [index: string]: Object; };
    public IndexSlot: string;
    public Index: string;

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

/** @description Represents a single asset type. */
export class AssetType
{
    public Workspace: string;
    public Type: string;
    public IsActive: boolean;
    public Name: string;
    public Make: string;
    public Model: string;
    public Manuf: string;
    public Barcode: string;
    public Symbol: string;
    public Color: string;
    public LineThickness: number;
    public Scale: number;
    public VisibilityMin: number;
    public VisibilityMax: number;
    public SyncNode: boolean;
    public CustomFields: CustomField[];
    public AllowedParentTypes: string[];
    public AllowedChildTypes: string[];
    public UseLocationHistory: boolean;
    public IsMobileAsset: boolean;
    public Data: { [index: string]: string; };
    public GeomType: string;
    public DocFilter: boolean;
    public ShowRelatedDocs: boolean;
    public AllowedDocTypes: string[];
    public TLA: string;
    public UseTLAOnMap: boolean;
    public RoutingLocation: string;
    public Fill: string;
    public FillOpacity: number;
    public ShowAnno: boolean;
    public AnnoColor: string;
    public MaxAnnoVisibility: number;
    public AnnoFont: string;
    public HideTypeLabel: boolean;
    public UseAddress: boolean;
    public UseFullScreen: boolean;
    public TimeSeries: number;
    public IsUnselectable: boolean;
    public EditTeams: string[];
    public IsWarehouse: boolean;
    public IsVehicle: boolean;
    public CustomSymbol: { [index: string]: Object; };
    public TaskSeriesTemplates: string[];

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

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

{
	Workspace: String,
	Type: String,
	IsActive: False,
	Name: String,
	Make: String,
	Model: String,
	Manuf: String,
	Barcode: String,
	Symbol: String,
	Color: String,
	LineThickness: 0,
	Scale: 0,
	VisibilityMin: 0,
	VisibilityMax: 0,
	SyncNode: False,
	CustomFields: 
	[
		{
			Key: String,
			Label: String,
			IsActive: False,
			IsReadOnly: False,
			IsHidden: False,
			IsMandatory: False,
			DisplayOnMap: False,
			CustomFieldDataType: Text,
			Values: String,
			Prompt: String,
			Default: String,
			DefaultAutoUpdate: False,
			RequiredIf: String,
			Hidden: 
			[
				String
			],
			ReadOnly: 
			[
				String
			],
			ControlArgs: 
			{
				String: String
			},
			UseArrayMergeType: Set,
			IndexSlot: String,
			Index: String
		}
	],
	AllowedParentTypes: 
	[
		String
	],
	AllowedChildTypes: 
	[
		String
	],
	UseLocationHistory: False,
	IsMobileAsset: False,
	Data: 
	{
		String: String
	},
	GeomType: String,
	DocFilter: False,
	ShowRelatedDocs: False,
	AllowedDocTypes: 
	[
		String
	],
	TLA: String,
	UseTLAOnMap: False,
	RoutingLocation: String,
	Fill: String,
	FillOpacity: 0,
	ShowAnno: False,
	AnnoColor: String,
	MaxAnnoVisibility: 0,
	AnnoFont: String,
	HideTypeLabel: False,
	UseAddress: False,
	UseFullScreen: False,
	TimeSeries: 0,
	IsUnselectable: False,
	EditTeams: 
	[
		String
	],
	IsWarehouse: False,
	IsVehicle: False,
	CustomSymbol: 
	{
		String: {}
	},
	TaskSeriesTemplates: 
	[
		String
	]
}