Field Squared API Services

<back to all web services

AssetList

/{Workspace}/AssetList returns a list of assets in the workspace.
IMPORTANT NOTE: The following 'core field' query parameters can be used to 'contains' filter tasks returned: name, types (comma separated list)
Custom task field 'contains' filters can also be specified by using the binding/key as the query parameter. i.e. Comments=Quick Brown Fox.
Spatial extents can be passed in using: bottomleft=Lat,Lon&topright=Lat,Lon.
To filter on tasks inside a boundary, use boundary=Lat,Lon,Lat,Lon etc.
To filter for assets based on full text search, use fulltext
To filter for assets that can be used as hierarchial nodes use the query parameter syncnodes=true
To filter and return all assets below asset X in the hiearchy, use the query parameter nodeid = X
To filter and return all root level assets, use the query parameter root = true
To filter and return all direct children assets for a given parent, use the query parameter parentid = X
To filter and return all assets modified since a date and time, use the query parameter modifiedsince = X where X = YYYY-MM-DDTHH:MM:SSZ
To filter and return all assets deleted since a date and time, use the query parameter deletedsince = X where X = YYYY-MM-DDTHH:MM:SSZ. Note only Object ID, Workspace and Version is populated.
Multiple sort orders can be specified using a strided list. sorts=value1,value2,value3 where value1 = field name, value2 = ascending/descending, value3 = true/false (true if field is a custom field).
Pagination - /{0}/AssetList?recstart=0&reccount=1.
To suppress geometry from being returned in an effort to improve performance, use the query parameter suppressgeometry=true
/{Workspace}/AssetList/Count returns a count, not the actual object list

The following routes are available for this service:
GET/{Workspace}/AssetList
GET/{Workspace}/AssetList/Count

export class Schedule
{
    public Workspace: string;
    public ObjectId: string;
    public VersionId: string;
    public BasedOn: string;
    public Start: string;
    public End: string;
    public TimeZone: string;
    public Users: string[];
    public Teams: string[];
    public Data: { [index: string]: Object; };

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

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 Geometry
{
    public Type: string;
    public Coordinates: Location[];

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

export class MaintenanceRecord
{
    public DateTime: string;
    public Notes: string;

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

export class LocationHistory
{
    public Date: string;
    public Location: Location;
    public Barcode: string;
    public Notes: string;
    public IsScan: boolean;

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

export class ClassedItem
{
    public ObjectId: string;
    public Class: string;
    public VersionId: string;
    public Ancestors: string[];
    public Type: string;

    public constructor(init?: Partial<ClassedItem>) { (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 Anno
{
    public X: number;
    public Y: number;
    public R: number;
    public S: number;
    public T: string;

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

export class AddressBasic
{
    public Street: string;
    public Unit: string;
    public City: string;
    public State: string;
    public Zip: string;
    public Country: string;
    public Location: Location;

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

export class CustomDataField
{
    public Binding: string;
    public Label: string;
    public Value: Object;
    public DataType: string;
    public IsReadOnly: boolean;
    public IsHidden: boolean;
    public Values: string;

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

/** @description Contains the data for an asset within the system. */
export class Asset
{
    public Workspace: string;
    public TimeZone: string;
    public AssignedWorkspace: string;
    public ObjectId: string;
    public VersionId: string;
    public BasedOn: string;
    public ExternalId: string;
    public Created: string;
    public LastUpdated: string;
    public Name: string;
    public Schedules: Schedule[];
    public Documents: DomainItem[];
    public Tasks: DomainItem[];
    public TaskSeries: string[];
    public TaskSeriesTemplates: string[];
    public Users: DomainItem[];
    public Type: string;
    public Symbol: string;
    public Data: { [index: string]: string; };
    public Geometry: Geometry;
    public MaintenanceHistory: MaintenanceRecord[];
    public Parent: string;
    public Ancestors: string[];
    public LocationHistory: LocationHistory[];
    public Owner: ClassedItem;
    public IsParent: boolean;
    public Assets: string[];
    public Contacts: string[];
    public GeometryString: string;
    public SourceProjection: string;
    public Events: EventItem[];
    public Anno: Anno;
    public Teams: string[];
    public Address: AddressBasic;
    public CreatedBy: string;
    public InventoryItems: string[];
    public ActiveLaborTypes: { [index: string]: Object; };
    public Levels: number;
    public AllAssests: number;
    public Barcode: string;
    public CustomDataFields: CustomDataField[];

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

/** @description /{Workspace}/AssetList returns a list of assets in the workspace.IMPORTANT NOTE: The following 'core field' query parameters can be used to 'contains' filter tasks returned: name, types (comma separated list)Custom task field 'contains' filters can also be specified by using the binding/key as the query parameter. i.e. Comments=Quick Brown Fox. Spatial extents can be passed in using: bottomleft=Lat,Lon&topright=Lat,Lon.  To filter on tasks inside a boundary, use boundary=Lat,Lon,Lat,Lon etc. To filter for assets based on full text search, use fulltext To filter for assets that can be used as hierarchial nodes use the query parameter syncnodes=true To filter and return all assets below asset X in the hiearchy, use the query parameter nodeid = X To filter and return all root level assets, use the query parameter root = true To filter and return all direct children assets for a given parent, use the query parameter parentid = X To filter and return all assets modified since a date and time, use the query parameter modifiedsince = X where X = YYYY-MM-DDTHH:MM:SSZ To filter and return all assets deleted since a date and time, use the query parameter deletedsince = X where X = YYYY-MM-DDTHH:MM:SSZ.  Note only Object ID, Workspace and Version is populated. Multiple sort orders can be specified using a strided list.  sorts=value1,value2,value3 where value1 = field name, value2 = ascending/descending, value3 = true/false (true if field is a custom field). Pagination - /{0}/AssetList?recstart=0&reccount=1. To suppress geometry from being returned in an effort to improve performance, use the query parameter suppressgeometry=true /{Workspace}/AssetList/Count returns a count, not the actual object list */
export class AssetList
{
    public Workspace: string;
    public DateGenerated: string;
    public Assets: Asset[];
    public RecordsAvailable: number;

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

TypeScript AssetList DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /{Workspace}/AssetList HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/csv