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
import java.math.*
import java.util.*
import net.servicestack.client.*


/**
* /{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
*/
open class AssetList
{
    var Workspace:String? = null
    var DateGenerated:String? = null
    var Assets:ArrayList<Asset> = ArrayList<Asset>()
    var RecordsAvailable:Long? = null
}

/**
* Contains the data for an asset within the system.
*/
open class Asset
{
    var Workspace:String? = null
    var TimeZone:String? = null
    var AssignedWorkspace:String? = null
    var ObjectId:String? = null
    var VersionId:String? = null
    var BasedOn:String? = null
    var ExternalId:String? = null
    var Created:String? = null
    var LastUpdated:String? = null
    var Name:String? = null
    var Schedules:ArrayList<Schedule> = ArrayList<Schedule>()
    var Documents:ArrayList<DomainItem> = ArrayList<DomainItem>()
    var Tasks:ArrayList<DomainItem> = ArrayList<DomainItem>()
    var TaskSeries:ArrayList<String> = ArrayList<String>()
    var TaskSeriesTemplates:ArrayList<String> = ArrayList<String>()
    var Users:ArrayList<DomainItem> = ArrayList<DomainItem>()
    var Type:String? = null
    var Symbol:String? = null
    var Data:HashMap<String,String> = HashMap<String,String>()
    var Geometry:Geometry? = null
    var MaintenanceHistory:ArrayList<MaintenanceRecord> = ArrayList<MaintenanceRecord>()
    var Parent:String? = null
    var Ancestors:ArrayList<String> = ArrayList<String>()
    var LocationHistory:ArrayList<LocationHistory> = ArrayList<LocationHistory>()
    var Owner:ClassedItem? = null
    var IsParent:Boolean? = null
    var Assets:ArrayList<String> = ArrayList<String>()
    var Contacts:ArrayList<String> = ArrayList<String>()
    var GeometryString:String? = null
    var SourceProjection:String? = null
    var Events:ArrayList<EventItem> = ArrayList<EventItem>()
    var Anno:Anno? = null
    var Teams:ArrayList<String> = ArrayList<String>()
    var Address:AddressBasic? = null
    var CreatedBy:String? = null
    var InventoryItems:ArrayList<String> = ArrayList<String>()
    var ActiveLaborTypes:HashMap<String,Object> = HashMap<String,Object>()
    var Levels:Int? = null
    var AllAssests:Int? = null
    var Barcode:String? = null
    var CustomDataFields:ArrayList<CustomDataField> = ArrayList<CustomDataField>()
}

open class Schedule
{
    var Workspace:String? = null
    var ObjectId:String? = null
    var VersionId:String? = null
    var BasedOn:String? = null
    var Start:String? = null
    var End:String? = null
    var TimeZone:String? = null
    var Users:ArrayList<String> = ArrayList<String>()
    var Teams:ArrayList<String> = ArrayList<String>()
    var Data:HashMap<String,Object> = HashMap<String,Object>()
}

open class DomainItem
{
    var Workspace:String? = null
    var ObjectId:String? = null
    var VersionId:String? = null
    var LastUpdated:String? = null
}

open class Geometry
{
    var Type:String? = null
    var Coordinates:ArrayList<Location> = ArrayList<Location>()
}

open class Location
{
    var y:Double? = null
    var x:Double? = null
}

open class MaintenanceRecord
{
    var DateTime:String? = null
    var Notes:String? = null
}

open class LocationHistory
{
    var Date:String? = null
    var Location:Location? = null
    var Barcode:String? = null
    var Notes:String? = null
    var IsScan:Boolean? = null
}

open class ClassedItem
{
    var ObjectId:String? = null
    var Class:String? = null
    var VersionId:String? = null
    var Ancestors:ArrayList<String> = ArrayList<String>()
    var Type:String? = null
}

open class EventItem
{
    var ObjectId:String? = null
    var Date:String? = null
    var Location:Location? = null
    var Barcode:String? = null
    var Details:String? = null
    var Type:String? = null
    var IsScan:Boolean? = null
    var User:String? = null
    var SelectedBy:String? = null
    var Status:String? = null
    var StatusType:String? = null
    var DateCreated:String? = null
    var Automatic:Boolean? = null
}

open class Anno
{
    var X:Double? = null
    var Y:Double? = null
    var R:Double? = null
    var S:Double? = null
    var T:String? = null
}

open class AddressBasic
{
    var Street:String? = null
    var Unit:String? = null
    var City:String? = null
    var State:String? = null
    var Zip:String? = null
    var Country:String? = null
    var Location:Location? = null
}

open class CustomDataField
{
    var Binding:String? = null
    var Label:String? = null
    var Value:Object? = null
    var DataType:String? = null
    var IsReadOnly:Boolean? = null
    var IsHidden:Boolean? = null
    var Values:String? = null
}

Kotlin 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