Attribute GetAttributesQuery
- Last UpdatedJun 15, 2023
- 2 minute read
- PI System
- PI Web API Reference
- Developer
Attribute GetAttributesQuery
Retrieve attributes based on the specified conditions. Returns attributes using the specified search query string.
Request
GET attributes/search
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 attributes in the asset database. An example would be: "query=Element:{ Name:='MyElement' } Type:=Int32". 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.
-
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 DataReference to return attributes with data references. If this parameter is not specified, DataReference values are not returned. See Associations for more information.
Status Codes
200: A list of attributes matching the specified conditions.
Sample Response Body
{
"Items": [
{
"WebId": "I1AbEDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBAGyPedZG1sUmxOOclp3Flwg",
"Id": "75de231b-b591-49b1-b138-e725a77165c2",
"Name": "Water",
"Description": "2008 Water Use",
"Path": "\\\\MyAssetServer\\MyDatabase\\CityName\\EngineeringProcess\\Equipment\\MachineName|Water(2008)",
"Paths": [
"\\\\MyAssetServer\\MyDatabase\\MyElement|MyAttribute",
"\\\\MyAssetServer\\MyDatabase\\ReferencingElement\\MyElement|MyAttribute"
],
"Type": "Int32",
"TypeQualifier": "",
"DefaultUnitsName": "liter",
"DisplayDigits": -5,
"DataReferencePlugIn": "Table Lookup",
"ConfigString": "SELECT [Water Use] FROM [Energy Use 2008] WHERE [Asset ID] = '%Element%'",
"IsConfigurationItem": false,
"IsExcluded": false,
"IsHidden": false,
"IsManualDataEntry": false,
"HasChildren": false,
"CategoryNames": [
"Energy Savings Targets"
],
"Step": false,
"TraitName": "LimitLoLo",
"DefaultUnitsNameAbbreviation": "L",
"Span": 100.0,
"Zero": 0.0,
"DataReference": null,
"Links": {
"Self": "https://localhost.osisoft.int/piwebapi/attributes/I1AbEDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBAGyPedZG1sUmxOOclp3Flwg"
}
},
{
"WebId": "I1AbEDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBAGyPedZG1sUmxOOclp3Flwg",
"Id": "75de231b-b591-49b1-b138-e725a77165c2",
"Name": "Water",
"Description": "2008 Water Use",
"Path": "\\\\MyAssetServer\\MyDatabase\\CityName\\EngineeringProcess\\Equipment\\MachineName|Water(2008)",
"Paths": [
"\\\\MyAssetServer\\MyDatabase\\MyElement|MyAttribute",
"\\\\MyAssetServer\\MyDatabase\\ReferencingElement\\MyElement|MyAttribute"
],
"Type": "Int32",
"TypeQualifier": "",
"DefaultUnitsName": "liter",
"DisplayDigits": -5,
"DataReferencePlugIn": "Table Lookup",
"ConfigString": "SELECT [Water Use] FROM [Energy Use 2008] WHERE [Asset ID] = '%Element%'",
"IsConfigurationItem": false,
"IsExcluded": false,
"IsHidden": false,
"IsManualDataEntry": false,
"HasChildren": false,
"CategoryNames": [
"Energy Savings Targets"
],
"Step": false,
"TraitName": "LimitLoLo",
"DefaultUnitsNameAbbreviation": "L",
"Span": 100.0,
"Zero": 0.0,
"DataReference": null,
"Links": {
"Self": "https://localhost.osisoft.int/piwebapi/attributes/I1AbEDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBAGyPedZG1sUmxOOclp3Flwg"
}
}
],
"Links": {}
}