GetChannelAdHoc
GET streamsets/channel
Opens a channel that will send messages about any value changes for the specified streams. See Channels for more information.
URL Parameters
-
webId
The ID of a stream. See Stream for more information. Multiple streams may be specified with multiple instances of the parameter. See WebID for more information.
-
includeInitialValues
Specified if the channel should send a message with the current values of all the streams after the connection is opened. The default is 'false'.
-
heartbeatRate
Specifies the maximum number of consecutive empty messages that can be elapsed with no new data updates from the PI System, after which the client receives an empty payload. It helps to check if the connection is still alive. Zero/negative values correspond to no heartbeat, and the default value is no heartbeat.
-
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.
Status Codes
101: Switches to the Web Socket protocol.
Sample Response
{
"Items": [
{
"WebId": "I1AbEDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBAGyPedZG1sUmxOOclp3Flwg",
"Name": "Water",
"Path": "\\\\MyAssetServer\\MyDatabase\\MyElement|Water",
"Value": {
"Timestamp": "2014-07-22T14:00:00Z",
"UnitsAbbreviation": "m",
"Good": true,
"Questionable": false,
"Substituted": false,
"Annotated": false,
"Value": 12.3
},
"Links": {
"Self": "https://localhost.osisoft.int/piwebapi/attributes/I1AbEDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBAGyPedZG1sUmxOOclp3Flwg"
}
},
{
"WebId": "I1AbEDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBAGyPedZG1sUmxOOclp3Flwg",
"Name": "Water",
"Path": "\\\\MyAssetServer\\MyDatabase\\MyElement|Water",
"Value": {
"Timestamp": "2014-07-22T14:00:00Z",
"UnitsAbbreviation": "m",
"Good": true,
"Questionable": false,
"Substituted": false,
"Annotated": false,
"Value": 12.3
},
"Links": {
"Self": "https://localhost.osisoft.int/piwebapi/attributes/I1AbEDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBAGyPedZG1sUmxOOclp3Flwg"
}
}
],
"Links": {}
}