Stream GetRecorded
- Last UpdatedJun 15, 2023
- 4 minute read
- PI System
- PI Web API Reference
- Developer
Stream GetRecorded
Returns a list of compressed values for the requested time range from the source provider.
Remarks
Returned times are affected by the specified boundary type. If no values are found for the time range and conditions specified then the HTTP response will be success, with a body containing an empty array of Items. When specifying true for the includeFilteredValues parameter, consecutive filtered events are not returned. The first value that would be filtered out is returned with its time and the enumeration value "Filtered". The next value in the collection will be the next compressed value in the specified direction that passes the filter criteria - if any. When both boundaryType and a filterExpression are specified, the events returned for the boundary condition specified are passed through the filter. If the includeFilteredValues parameter is true, the boundary values will be reported at the proper timestamps with the enumeration value "Filtered" when the filter conditions are not met at the boundary time. If the includeFilteredValues parameter is false for this case, no event is returned for the boundary time. Any time series value in the response that contains an 'Errors' property indicates PI Web API encountered a handled error during the transfer of the response stream. See Error Handling for more information. If only recorded values with annotations are desired, the filterExpression parameter should include the filter IsSet('.', "a").
Request
GET streams/{webId}/recorded
URL Parameters
-
webId The ID of the stream. See WebID for more information.
-
startTime An optional start time. The default is '*-1d' for element attributes and points. For event frame attributes, the default is the event frame's start time, or '*-1d' if that is not set. See Time Strings for more information.
-
endTime An optional end time. The default is '*' for element attributes and points. For event frame attributes, the default is the event frame's end time, or '*' if that is not set. Note that if endTime is earlier than startTime, the resulting values will be in time-descending order. See Time Strings for more information.
-
timeZone The time zone in which the time string will be interpreted. This parameter will be ignored if a time zone is specified in the time string. If no time zone is specified in either places, the PI Web API server time zone will be used. See Time Zone for more information.
-
boundaryType An optional value that determines how the times and values of the returned end points are determined. The default is 'Inside'. See Boundary Type for more information.
-
desiredUnits The name or abbreviation of the desired units of measure for the returned value, as found in the UOM database associated with the attribute. If not specified for an attribute, the attribute's default unit of measure is used. If the underlying stream is a point, this value may not be specified, as points are not associated with a unit of measure.
-
filterExpression An optional string containing a filter expression. Expression variables are relative to the data point. Use '.' to reference the containing attribute. The default is no filtering.
-
includeFilteredValues Specify 'true' to indicate that values which fail the filter criteria are present in the returned data at the times where they occurred with a value set to a 'Filtered' enumeration value with bad status. Repeated consecutive failures are omitted.
-
maxCount The maximum number of values to be returned. 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.
-
associations Associated values to return in the response, separated by semicolons (;). This call supports Annotations to return events with annotation values. If this parameter is not specified, annotation values are not returned. See Associations for more information.
Status Codes
200: The values that meet the specified conditions.
400: The request was malformed.
409: The data reference does not support the method, or the supplied filter expression is unsupported, or the desired units of measure are incompatible, or an unsupported association was specified.
Sample Response Body
{
"Items": [
{
"Annotations": [
{
"Id": "512B6616-CE39-4F70-9048-8C6A025FB592",
"Name": "Temperature Annotation",
"Description": "Signifies a spike in temperature.",
"Value": "The temperature spiked because of a malfunction with a unit in our west plant.",
"Creator": "MyDomain\\UserA",
"CreationDate": "2016-06-21T14:45:50.2988321Z",
"Modifier": "MyDomain\\UserA",
"ModifyDate": "2016-06-21T14:45:50.2988321Z",
"Errors": null
},
{
"Id": "512B6616-CE39-4F70-9048-8C6A025FB592",
"Name": "Temperature Annotation",
"Description": "Signifies a spike in temperature.",
"Value": "The temperature spiked because of a malfunction with a unit in our west plant.",
"Creator": "MyDomain\\UserA",
"CreationDate": "2016-06-21T14:45:50.2988321Z",
"Modifier": "MyDomain\\UserA",
"ModifyDate": "2016-06-21T14:45:50.2988321Z",
"Errors": null
}
],
"Timestamp": "2014-07-22T14:00:00Z",
"UnitsAbbreviation": "m",
"Good": true,
"Questionable": false,
"Substituted": false,
"Annotated": false,
"Value": 12.3
},
{
"Annotations": [
{
"Id": "512B6616-CE39-4F70-9048-8C6A025FB592",
"Name": "Temperature Annotation",
"Description": "Signifies a spike in temperature.",
"Value": "The temperature spiked because of a malfunction with a unit in our west plant.",
"Creator": "MyDomain\\UserA",
"CreationDate": "2016-06-21T14:45:50.2988321Z",
"Modifier": "MyDomain\\UserA",
"ModifyDate": "2016-06-21T14:45:50.2988321Z",
"Errors": null
},
{
"Id": "512B6616-CE39-4F70-9048-8C6A025FB592",
"Name": "Temperature Annotation",
"Description": "Signifies a spike in temperature.",
"Value": "The temperature spiked because of a malfunction with a unit in our west plant.",
"Creator": "MyDomain\\UserA",
"CreationDate": "2016-06-21T14:45:50.2988321Z",
"Modifier": "MyDomain\\UserA",
"ModifyDate": "2016-06-21T14:45:50.2988321Z",
"Errors": null
}
],
"Timestamp": "2014-07-22T14:00:00Z",
"UnitsAbbreviation": "m",
"Good": true,
"Questionable": false,
"Substituted": false,
"Annotated": false,
"Value": 12.3
}
],
"Links": {}
}