GetElementsQuery
GET elements/search
Retrieve elements based on the specified conditions. By default, returns all the elements.
URL Parameters
-
databaseWebId
The ID of the asset database to use as the root of the query. See WebID for more information.
-
query
The query string is a list of filters used to perform an AFSearch for the elements in the asset database. An example would be: "query=Name:=MyElement* Template:=ElementTemplate". See Search Query Syntax for more information.See URL Encoding for more information.
-
startIndex
The starting index (zero based) of the items to be returned. The default is 0.
-
maxCount
The maximum number of objects to be returned per call (page size). The default is 1000.
-
queryDate
Optional parameter. Used to retrieve the relative the version of an object. A value of null or AFTime.MaxValue initializes the query date so the latest versions of sub-objects are retrieved. The value may be an AFTime, DateTime, PITime, String, or numeric. An integer numeric represents the number of ticks (100-nanosecond intervals) since January 1, 0001. A floating point numeric represents the number of seconds since January 1, 1970 UTC. A String is interpreted as local time, unless it contains a time zone indicator such as a trailing "Z" or "GMT".
-
selectedFields
List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.
-
webIdType
Optional parameter. Used to specify the type of WebID. Useful for URL brevity and other special cases. Default is the value of the configuration item "WebIDType". See WebID Type for more information.
-
associations
Associated values to return in the response, separated by semicolons (;). This call supports Paths to return all paths to the element. If this parameter is not specified, paths are not returned. See Associations for more information.
Status Codes
200: A list of elements matching the specified conditions.
Sample Response
{
"Items": [
{
"WebId": "I1EmDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBA",
"Id": "cbb28260-853d-11e4-80c5-00155d844304",
"Name": "MachineName",
"Description": "Manufacturing Equipment MachineName",
"Path": "\\\\MyAssetServer\\MyDatabase\\CityName\\EngineeringProcess\\Equipment\\MachineName",
"Paths": null,
"TemplateName": "MachineName",
"HasChildren": false,
"CategoryNames": [
"Equipment Assets"
],
"ExtendedProperties": {},
"Errors": null,
"Links": {
"Self": "https://localhost.osisoft.int/piwebapi/elements/I1EmDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBA"
}
},
{
"WebId": "I1EmDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBA",
"Id": "cbb28260-853d-11e4-80c5-00155d844304",
"Name": "MachineName",
"Description": "Manufacturing Equipment MachineName",
"Path": "\\\\MyAssetServer\\MyDatabase\\CityName\\EngineeringProcess\\Equipment\\MachineName",
"Paths": null,
"TemplateName": "MachineName",
"HasChildren": false,
"CategoryNames": [
"Equipment Assets"
],
"ExtendedProperties": {},
"Errors": null,
"Links": {
"Self": "https://localhost.osisoft.int/piwebapi/elements/I1EmDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBA"
}
}
],
"Links": {}
}