Field Squared API Services

<back to all web services

AssetQuery

/{Workspace}/AssetQuery allows flexible querying of assets using structured filters.
Supports various operators (eq, ne, contains, in, gt, lt, exists) for precise asset searches.
Can query by core fields (type, name, created) and custom data fields (data.EID, data.FDH_ID, etc.).
Example: POST with filters for exact matches on type='FDH' and data.EID='specific-value'

The following routes are available for this service:
POST/{Workspace}/AssetQuery
System.NotSupportedException: Unknown language 'mjs', Supported languages: csharp, typescript, dart, java, kotlin, python, swift, vbnet, fsharp
   at ServiceStack.NativeTypes.LangGeneratorExtensions.GenerateSourceCode(MetadataTypes metadataTypes, MetadataTypesConfig typesConfig, String lang, IRequest req, Action`1 configure) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/NativeTypes/ILangGenerator.cs:line 53
   at ServiceStack.NativeTypes.LangGeneratorExtensions.GenerateSourceCode(List`1 metadataTypes, String lang, IRequest req, Action`1 configure) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/NativeTypes/ILangGenerator.cs:line 26
   at ServiceStack.Metadata.BaseMetadataHandler.d__12.MoveNext() in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/Metadata/BaseMetadataHandler.cs:line 207

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

{
	Workspace: String,
	Filters: 
	[
		{
			Field: String,
			Operator: String,
			Value: {}
		}
	],
	RecStart: 0,
	RecCount: 0,
	Sort: 
	[
		{
			Field: String,
			Direction: String
		}
	],
	SuppressGeometry: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Assets: 
	[
		{
			Workspace: String,
			TimeZone: String,
			AssignedWorkspace: String,
			ObjectId: String,
			VersionId: String,
			BasedOn: String,
			ExternalId: String,
			Created: String,
			LastUpdated: String,
			Name: String,
			Schedules: 
			[
				{
					Workspace: String,
					ObjectId: String,
					VersionId: String,
					BasedOn: String,
					Start: String,
					End: String,
					TimeZone: String,
					Users: 
					[
						String
					],
					Teams: 
					[
						String
					],
					Data: 
					{
						String: {}
					}
				}
			],
			Documents: 
			[
				{
					Workspace: String,
					ObjectId: String,
					VersionId: String,
					LastUpdated: String
				}
			],
			Tasks: 
			[
				{
					Workspace: String,
					ObjectId: String,
					VersionId: String,
					LastUpdated: String
				}
			],
			TaskSeries: 
			[
				String
			],
			TaskSeriesTemplates: 
			[
				String
			],
			Users: 
			[
				{
					Workspace: String,
					ObjectId: String,
					VersionId: String,
					LastUpdated: String
				}
			],
			Type: String,
			Symbol: String,
			Data: 
			{
				String: String
			},
			Geometry: 
			{
				Type: String,
				Coordinates: 
				[
					{
						y: 0,
						x: 0
					}
				]
			},
			MaintenanceHistory: 
			[
				{
					DateTime: String,
					Notes: String
				}
			],
			Parent: String,
			Ancestors: 
			[
				String
			],
			LocationHistory: 
			[
				{
					Date: String,
					Location: 
					{
						y: 0,
						x: 0
					},
					Barcode: String,
					Notes: String,
					IsScan: False
				}
			],
			Owner: 
			{
				ObjectId: String,
				Class: String,
				VersionId: String,
				Ancestors: 
				[
					String
				],
				Type: String
			},
			IsParent: False,
			Assets: 
			[
				String
			],
			Contacts: 
			[
				String
			],
			GeometryString: String,
			SourceProjection: 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
				}
			],
			Anno: 
			{
				X: 0,
				Y: 0,
				R: 0,
				S: 0,
				T: String
			},
			Teams: 
			[
				String
			],
			Address: 
			{
				Street: String,
				Unit: String,
				City: String,
				State: String,
				Zip: String,
				Country: String,
				Location: 
				{
					y: 0,
					x: 0
				}
			},
			CreatedBy: String,
			InventoryItems: 
			[
				String
			],
			ActiveLaborTypes: 
			{
				String: {}
			},
			Levels: 0,
			AllAssests: 0,
			Barcode: String,
			CustomDataFields: 
			[
				{
					Binding: String,
					Label: String,
					Value: {},
					DataType: String,
					IsReadOnly: False,
					IsHidden: False,
					Values: String
				}
			]
		}
	],
	TotalCount: 0,
	RecStart: 0,
	RecCount: 0
}