### Get Recorded Data Example Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/stream/actions/getrecorded.html This example shows a sample response body for retrieving recorded data. It includes a list of data items, each with its timestamp, value, and associated annotations. ```APIDOC ## GET /api/v1/stream/recorded ### Description Retrieves recorded data points within a specified time range, optionally filtered by tag names and including associated annotations. ### Method GET ### Endpoint /api/v1/stream/recorded ### Parameters #### Query Parameters - **tagNames** (string) - Optional - Comma-separated list of tag names to retrieve data for. - **startTime** (string) - Required - The start of the time range for recorded data (ISO 8601 format). - **endTime** (string) - Required - The end of the time range for recorded data (ISO 8601 format). - **includeAnnotations** (boolean) - Optional - Whether to include annotations with the data points. Defaults to false. ### Response #### Success Response (200) - **Items** (array) - An array of recorded data items. - **Annotations** (array) - An array of annotations associated with the data item. - **Id** (string) - The unique identifier of the annotation. - **Name** (string) - The name of the annotation. - **Description** (string) - A description of the annotation. - **Value** (string) - The value or details of the annotation. - **Creator** (string) - The user or system that created the annotation. - **CreationDate** (string) - The date and time the annotation was created. - **Modifier** (string) - The user or system that last modified the annotation. - **ModifyDate** (string) - The date and time the annotation was last modified. - **Errors** (any) - Any errors associated with the annotation. - **Timestamp** (string) - The timestamp of the data point (ISO 8601 format). - **UnitsAbbreviation** (string) - The abbreviation for the units of the data point. - **Good** (boolean) - Indicates if the data point is considered good. - **Questionable** (boolean) - Indicates if the data point is questionable. - **Substituted** (boolean) - Indicates if the data point value was substituted. - **Annotated** (boolean) - Indicates if the data point has annotations. - **Value** (number) - The recorded value of the data point. - **Links** (object) - Links related to the response, if any. #### Response Example ```json { "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 } ], "Timestamp": "2014-07-22T14:00:00Z", "UnitsAbbreviation": "m", "Good": true, "Questionable": false, "Substituted": false, "Annotated": false, "Value": 12.3 } ], "Links": {} } ``` ``` -------------------------------- ### Example GET Request to PI Web API Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/getting-started.html This is a complete GET request to the PI Web API, showing the method, resource URL, and essential headers like Host and Accept. ```http GET https://myserver/piwebapi/assetdatabases/D0NxzXSxtlKkGzAhZfHOB-KAQLhZ5wrU-UyRDQnzB_zGVAUEhMQUZTMDRcTlVHUkVFTg HTTP/1.1 Host: myserver Accept: application/json ``` -------------------------------- ### Example Response Header Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/configuration/actions/putconfiguration.html This example shows a portion of a response header that might be returned. It lists allowed content-related headers. ```text "Allow,Content-Encoding,Content-Length,Date,Location" ``` -------------------------------- ### Example CORS Request for Simple Cross-Domain Access Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/topics/cross-origin-resource-sharing.html This example shows a simple GET request from a different origin. To allow this, the CorsOrigins attribute must be configured to include 'http://my-internal-site.internal' or a wildcard. ```http GET http://my-pisystem.internal/piwebapi HTTP/1.1 Origin: http://my-internal-site.internal ``` -------------------------------- ### Get Multiple Points Example Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/point/actions/getmultiple.html This example demonstrates how to retrieve multiple point objects by providing their identifiers. The response includes detailed information for each point, such as its WebId, Name, Path, and other attributes. It also includes an 'Exception' field which will be null if the point was retrieved successfully. ```APIDOC ## GET /points ### Description Retrieves multiple point objects. Supply the identifiers of the points you wish to retrieve in the request body. ### Method GET ### Endpoint /points ### Parameters #### Query Parameters - **databaseWebId** (string) - Optional - The web ID of the database to use. This is required when the web exception is not specified. - **selectedFields** (string) - Optional - Specifies a subset of fields to be returned. The available fields are: - `Items` - `Items.Identifier` - `Items.IdentifierType` - `Items.Object` - `Items.Object.WebId` - `Items.Object.Id` - `Items.Object.Name` - `Items.Object.Path` - `Items.Object.Descriptor` - `Items.Object.PointClass` - `Items.Object.PointType` - `Items.Object.DigitalSetName` - `Items.Object.Span` - `Items.Object.Zero` - `Items.Object.EngineeringUnits` - `Items.Object.Step` - `Items.Object.Future` - `Items.Object.DisplayDigits` - `Items.Object.Links` - `Items.Object.Links.Self` - `Items.Exception` - `Links` - **webException** (string) - Optional - The web exception to use when retrieving the points. #### Request Body - **Identifiers** (array of strings) - Required - The list of point identifiers (name or path) to retrieve. ### Request Example ```json { "Identifiers": [ "PointName1", "\\Server\PointName2" ] } ``` ### Response #### Success Response (200) - **Items** (array) - A list of point objects. - **Identifier** (string) - The identifier of the point. - **IdentifierType** (string) - The type of the identifier (e.g., 'Name', 'Path'). - **Object** (object) - The point object containing detailed attributes. - **WebId** (string) - The WebId of the point. - **Id** (integer) - The ID of the point. - **Name** (string) - The name of the point. - **Path** (string) - The path of the point. - **Descriptor** (string) - The descriptor of the point. - **PointClass** (string) - The point class. - **PointType** (string) - The point type. - **DigitalSetName** (string) - The name of the digital set, if applicable. - **Span** (number) - The span of the point. - **Zero** (number) - The zero value of the point. - **EngineeringUnits** (string) - The engineering units of the point. - **Step** (boolean) - Indicates if the point is a step type. - **Future** (boolean) - Indicates if the point is a future type. - **DisplayDigits** (integer) - The number of display digits. - **Links** (object) - Links to related resources. - **Self** (string) - Link to the point resource. - **Exception** (object) - An exception object if an error occurred while retrieving the point. Null if successful. - **Links** (object) - Links to related resources. #### Response Example ```json { "Items": [ { "Identifier": "\\server\path", "IdentifierType": "Path", "Object": { "WebId": "I1DPa70Wf0zBA06CLkV9ovNQgQCAAAAA", "Id": 82, "Name": "PointName", "Path": "\\MyPIServer\PointName", "Descriptor": "12 Hour Sine Wave", "PointClass": "classic", "PointType": "Float32", "DigitalSetName": "", "Span": 100.0, "Zero": 0.0, "EngineeringUnits": "", "Step": false, "Future": false, "DisplayDigits": -5, "Links": { "Self": "https://localhost.osisoft.int/piwebapi/points/I1DPa70Wf0zBA06CLkV9ovNQgQCAAAAA" } }, "Exception": null } ], "Links": {} } ``` ``` -------------------------------- ### Single Dictionary Parameter Example Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/topics/dictionary-parameters.html Shows how to provide a single dictionary parameter to an endpoint that accepts a URL parameter named 'Foo'. ```url ?Foo[Name1]=Value1 ``` -------------------------------- ### Multiple Dictionary Parameters Example Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/topics/dictionary-parameters.html Demonstrates how to pass multiple dictionary parameters to an endpoint accepting a URL parameter named 'Bar'. Each parameter is a distinct key-value pair. ```url ?Bar[City]=London&Bar[StartTime]=1-1-2017 00:01:00.123 ``` -------------------------------- ### GET Event Frame Attributes Request Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/eventframe/actions/findeventframeattributes.html This is an example of a GET request to retrieve event frame attributes for a specific event frame. Replace '{webId}' with the actual WebId of the event frame. ```http GET eventframes/{webId}/eventframeattributes ``` -------------------------------- ### Example CORS Supports Credentials Configuration Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/topics/cross-origin-resource-sharing.html Enable sending user credentials with cross-domain requests. Set to `true` for Basic or Kerberos Authentication. Cannot be used with wildcard origins. ```text true ``` -------------------------------- ### Get Notification Rule Subscribers Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/notificationrule/actions/getnotificationrulesubscribers.html This example demonstrates how to retrieve all subscribers for a given notification rule using its WebId. ```APIDOC ## GET notificationrules/{webId}/notificationrulesubscribers ### Description Retrieves a list of notification rule subscribers for a specified notification rule. ### Method GET ### Endpoint notificationrules/{webId}/notificationrulesubscribers ### Parameters #### Path Parameters - **webId** (string) - Required - The ID of the notification rule. ### Response #### Success Response (200) - **Items** (array) - A list of notification rule subscribers. - **WebId** (string) - The unique identifier for the subscriber. - **Id** (string) - The unique identifier for the subscriber. - **Name** (string) - The name of the subscriber. - **Description** (string) - A description of the subscriber. - **Path** (string) - The path to the subscriber in the asset hierarchy. - **ConfigString** (string) - Configuration string for the subscriber. - **ContactTemplateName** (string) - The name of the contact template. - **ContactType** (string) - The type of contact. - **DeliveryFormatName** (string) - The name of the delivery format. - **PlugInName** (string) - The name of the plug-in used for delivery. - **EscalationTimeout** (string) - The escalation timeout duration. - **MaximumRetries** (string) - The maximum number of retries. - **NotifyOption** (string) - The notification option. - **RetryInterval** (string) - The retry interval duration. - **Links** (object) - Links to related resources. - **Self** (string) - Link to the subscriber resource. #### Response Example ```json { "Items": [ { "WebId": "I1NSLDqD5loBNH0erqeqJodtALA5bYfWno26BGgMQAVXYR0AgPUJJXNlEW1w78rnCXDmcDA", "Id": "e9a984d0-f47c-11e7-8454-00155d029708", "Name": "NotificationSubscriptionRuleName", "Description": "Manufacturing Machine MachineName subscription", "Path": "\\MyAssetServer\MyDatabase\NotificationRules[NotificationSubscriptionRuleName]", "ConfigString": "ToEmail=mike@testemail.com", "ContactTemplateName": "Plant Manager", "ContactType": "Individual", "DeliveryFormatName": "DeliveryFormat", "PlugInName": "Email", "EscalationTimeout": "PT3S", "MaximumRetries": "3", "NotifyOption": "EventStart", "RetryInterval": "PT3S", "Links": { "Self": "https://localhost.osisoft.int/piwebapi/notificationrulesubscribers/I1NSLDqD5loBNH0erqeqJodtALA5bYfWno26BGgMQAVXYR0AgPUJJXNlEW1w78rnCXDmcDA" } } ], "Links": {} } ``` ``` -------------------------------- ### Sample Response Body - Headers Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/configuration/actions/getconfiguration.html This is a sample of the response body headers for a configuration item. ```text "Allow","Content-Encoding","Content-Length","Date","Location" ``` -------------------------------- ### Get Time Rule Plug-ins Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/assetserver/actions/gettimeruleplugins.html Retrieves a list of all Time Rule Plug-in's installed on the specified asset server. ```APIDOC ## AssetServer GetTimeRulePlugIns ### Description Retrieve a list of all Time Rule Plug-in's. ### Method GET ### Endpoint assetservers/{webId}/timeruleplugins ### Parameters #### Path Parameters - **webId** (string) - Required - The ID of the asset server, where the Time Rule Plug-in's are installed. #### Query Parameters - **selectedFields** (string) - Optional - 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** (string) - Optional - 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. ### Response #### Success Response (200) A list of Time Rule Plug-in's. ``` -------------------------------- ### Register and Receive Stream Updates (JavaScript) Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/topics/stream-updates.html This sample client demonstrates how to register for stream updates by sending a POST request and then periodically retrieve updates using a marker. It schedules the retrieval of updates every five seconds. ```javascript // Replace with your own PI Web API server var piWebApi = 'https://myserver/piwebapi'; var marker = null; // Calling DataQuery() will make an initial call to register for updates and // schedule ReceiveUpdates() to run every five seconds. // Updates will be written to the console. function DataQuery() { // web id of the attribute signed up for updates var webId = "I1AbEDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBAGyPedZG1sUmxOOclp3Flwg"; var url = `${piWebApi}/streams/${webId}/updates`; var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.open("POST", url); xhr.setRequestHeader("X-Requested-With", "XHR"); xhr.onload = function() { // Set latest marker marker = JSON.parse(xhr.responseText).LatestMarker; // Start up a thread to retrieve updates every 5 seconds openedThread = setInterval(ReceiveUpdates, 5000); } xhr.send(); } function ReceiveUpdates() { if (marker == null) { return; } var xhr = new XMLHttpRequest(); var url = `${piWebApi}/streams/updates/${marker}`; xhr.withCredentials = true; xhr.open("GET", url); xhr.onload = function() { var response = JSON.parse(xhr.responseText); // Update Marker marker = response.LatestMarker; // Display latest Events console.log(response.Events); } xhr.send(); } ``` -------------------------------- ### Get Analysis Rule Plug-Ins Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/assetserver/actions/getanalysisruleplugins.html Retrieves a list of all Analysis Rule Plug-in's installed on the specified asset server. ```APIDOC ## GET assetservers/{webId}/analysisruleplugins ### Description Retrieve a list of all Analysis Rule Plug-in's. ### Method GET ### Endpoint assetservers/{webId}/analysisruleplugins ### Parameters #### Path Parameters - **webId** (string) - Required - The ID of the asset server, where the Analysis Rule Plug-in's are installed. #### Query Parameters - **selectedFields** (string) - Optional - 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** (string) - Optional - 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. ### Response #### Success Response (200) - A list of Analysis Rule Plug-in's. ``` -------------------------------- ### System Landing Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/system/actions/landing.html Retrieves system links for the PI System Web API instance, including product title, version, and links to various system resources. ```APIDOC ## GET system ### Description Get system links for this PI System Web API instance. ### Method GET ### Endpoint system ### Response #### Success Response (200) - **ProductTitle** (string) - The title of the PI Web API product. - **ProductVersion** (string) - The version of the PI Web API product. - **Links** (object) - A collection of links to other system resources. - **Self** (string) - Link to the system landing page. - **CacheInstances** (string) - Link to cache instances. - **Configuration** (string) - Link to system configuration. - **UserInfo** (string) - Link to user information. - **Versions** (string) - Link to product versions. - **Status** (string) - Link to system status. - **InstanceConfiguration** (string) - Link to instance configuration. ### Request Example ``` GET system ``` ### Response Example ```json { "ProductTitle": "PI Web API 2019 SP1", "ProductVersion": "1.13.0.6298", "Links": { "Self": "https://myserver/piwebapi/system", "CacheInstances": "https://myserver/piwebapi/system/cacheinstances", "Configuration": "https://myserver/piwebapi/system/configuration", "UserInfo": "https://myserver/piwebapi/system/userinfo", "Versions": "https://myserver/piwebapi/system/versions", "Status": "https://myserver/piwebapi/system/status", "InstanceConfiguration": "https://myserver/piwebapi/system/instanceconfiguration" } } ``` ``` -------------------------------- ### Get Multiple Elements by Path Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/element/actions/getmultiple.html This example demonstrates how to retrieve multiple element objects by specifying their paths. The response includes detailed information for each element found. ```APIDOC ## GET /elements ### Description Retrieves multiple element objects. You can specify elements by their paths or WebIDs. ### Method GET ### Endpoint /elements ### Query Parameters - **path** (string) - Optional - The path(s) of the element(s) to retrieve. Multiple paths can be specified by separating them with a semicolon. - **webId** (string) - Optional - The WebID(s) of the element(s) to retrieve. Multiple WebIDs can be specified by separating them with a semicolon. ### Response #### Success Response (200) - **Items** (array) - A list of element objects. - **Identifier** (string) - The identifier of the element (e.g., path or WebID). - **IdentifierType** (string) - The type of the identifier ('Path' or 'WebId'). - **Object** (object) - Detailed information about the element. - **WebId** (string) - The unique WebID of the element. - **Id** (string) - The unique ID of the element. - **Name** (string) - The name of the element. - **Description** (string) - The description of the element. - **Path** (string) - The path of the element. - **TemplateName** (string) - The name of the template used for the element. - **HasChildren** (boolean) - Indicates if the element has children. - **CategoryNames** (array of strings) - Names of the categories the element belongs to. - **ExtendedProperties** (object) - Key-value pairs for extended properties. - **Errors** (object) - Information about any errors encountered. - **Links** (object) - Links to related resources. - **Self** (string) - Link to the element itself. - **Exception** (object) - Information about any exceptions encountered during retrieval. - **Links** (object) - Links to related resources. ### Request Example ``` GET /elements?path=\\server\path1;\\server\path2 ``` ### Response Example ```json { "Items": [ { "Identifier": "\\server\path", "IdentifierType": "Path", "Object": { "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" } }, "Exception": null } ], "Links": {} } ``` ``` -------------------------------- ### Sample Response Body for Stream Setup Updates Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/streamset/actions/retrievestreamsetupdates.html This JSON object represents the structure of a successful response when retrieving stream setup updates. It includes details about the items, their sources, and any associated events. ```json { "Items": [ { "Source": "I1AbEDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBAGyPedZG1sUmxOOclp3Flwg", "SourceName": "Water", "SourcePath": "\\MyAssetServer\MyDatabase\MyElement|Water", "RequestedMarker": "0cbbec466f3a42288c8c47112f54b852_0", "LatestMarker": "0cbbec466f3a42288c8c47112f54b852_12", "Status": "Updated", "Events": [ { "Action": "Add", "PreviousEventAction": "PreviousEventArchived", "Timestamp": "2014-07-22T14:00:00Z", "UnitsAbbreviation": "m", "Good": true, "Questionable": false, "Substituted": false, "Annotated": false, "Value": 12.3 }, { "Action": "Add", "PreviousEventAction": "PreviousEventArchived", "Timestamp": "2014-07-22T14:00:00Z", "UnitsAbbreviation": "m", "Good": true, "Questionable": false, "Substituted": false, "Annotated": false, "Value": 12.3 } ], "Links": {} }, { "Source": "I1AbEDqD5loBNH0erqeqJodtALAYIKyyz2F5BGAxQAVXYRDBAGyPedZG1sUmxOOclp3Flwg", "SourceName": "Water", "SourcePath": "\\MyAssetServer\MyDatabase\MyElement|Water", "RequestedMarker": "0cbbec466f3a42288c8c47112f54b852_0", "LatestMarker": "0cbbec466f3a42288c8c47112f54b852_12", "Status": "Updated", "Events": [ { "Action": "Add", "PreviousEventAction": "PreviousEventArchived", "Timestamp": "2014-07-22T14:00:00Z", "UnitsAbbreviation": "m", "Good": true, "Questionable": false, "Substituted": false, "Annotated": false, "Value": 12.3 }, { "Action": "Add", "PreviousEventAction": "PreviousEventArchived", "Timestamp": "2014-07-22T14:00:00Z", "UnitsAbbreviation": "m", "Good": true, "Questionable": false, "Substituted": false, "Annotated": false, "Value": 12.3 } ], "Links": {} } ], "Links": {} } ``` -------------------------------- ### GET Channel Instances Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/channel/actions/instances.html Use this endpoint to retrieve a list of all currently running channel instances. The response includes details such as the instance ID, start time, and message statistics. ```bash GET channels/instances ``` -------------------------------- ### Home Get Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/home/actions/get.html Retrieves top-level links for the PI System Web API instance, including links to asset servers, data servers, and system information. ```APIDOC ## Home Get ### Description Get top level links for this PI System Web API instance. ### Method GET ### Endpoint / ### Response #### Success Response (200) - **Links** (object) - Contains links to top-level collections and system information. - **Self** (string) - Link to the home endpoint. - **AssetServers** (string) - Link to the Asset Servers collection. - **DataServers** (string) - Link to the Data Servers collection. - **System** (string) - Link to the System information. ### Request Example ``` GET / ``` ### Response Example ```json { "Links": { "Self": "https://myserver/piwebapi/", "AssetServers": "https://myserver/piwebapi/assetservers", "DataServers": "https://myserver/piwebapi/dataservers", "System": "https://myserver/piwebapi/system" } } ``` ``` -------------------------------- ### Sample Response Body for NotificationRule Get Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/notificationrule/actions/get.html This is an example of the JSON response body returned when successfully retrieving a notification rule. It includes details such as WebId, Id, Name, Description, and configuration settings. ```json { "WebId": "I1NRDqD5loBNH0erqeqJodtALA5bYfWno26BGgMQAVXYR0Ag", "Id": "e9a984d0-f47c-11e7-8454-00155d029708", "Name": "MachineName", "Description": "Manufacturing Equipment MachineName", "Path": "\\MyAssetServer\MyDatabase\CityName\EngineeringProcess\Equipment\MachineName\NotificationRules[RuleName]", "AutoCreated": true, "CategoryNames": [ "Equipment Assets" ], "Criteria": "Name: EventFrameCriteriaName", "MultiTriggerEventOption": "HighestSeverity", "NonrepetitionInterval": "PT3S", "ResendInterval": "PT5S", "Status": "Disabled", "TemplateName": "MachineName Notification Rule", "Links": { "Self": "https://localhost.osisoft.int/piwebapi/notificationrules/I1NRDqD5loBNH0erqeqJodtALA5bYfWno26BGgMQAVXYR0Ag" } } ``` -------------------------------- ### Sample Response Body for AnalysisRulePlugIn Get Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/analysisruleplugin/actions/get.html This is an example of the JSON response body when successfully retrieving an Analysis Rule Plug-in. It contains details such as WebId, Id, Name, Description, Path, and assembly information. ```json { "WebId": "I1XPDqD5loBNH0erqeqJodtALABWwqmmFvekaFShbb-52MAw", "Id": "9a2a6c05-6f61-467a-854a-16dbfb9d8c03", "Name": "Imbalance", "Description": "Calculates simple material imbalances on nodes of a model.", "Path": "\\\MyAssetServer\PlugInsAnalysisRule[Imbalance]", "AssemblyFileName": "OSIsoft.AF.Analysis.AnalysisRule.Imbalance.dll", "AssemblyID": "1acd00c2-79d0-4818-a03c-0616c4513750", "AssemblyLoadProperties": [ "None" ], "AssemblyTime": "2016-05-25T14:01:07Z", "CompatibilityVersion": 2, "IsBrowsable": true, "IsNonEditableConfig": false, "LoadedAssemblyTime": "1970-01-01T00:00:00Z", "LoadedVersion": "", "Version": "2.8.5.7552", "Links": { "Self": "https://localhost.osisoft.int/piwebapi/analysisruleplugins/I1XPDqD5loBNH0erqeqJodtALABWwqmmFvekaFShbb-52MAw" } } ``` -------------------------------- ### Complete Multipart HTTP Request Example Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/topics/multipart-requests.html This example demonstrates a full multipart HTTP request with three different body parts: plain text, JSON, and RTF. It includes the necessary headers and boundary markers. ```http POST /an/example/path HTTP/1.1 Host: www.mywebsite.com Content-Type: multipart/form-data; boundary=MYBOUNDARY --MYBOUNDARY This is the body area of the first body part. Note that this body part has an empty header area (indicating that the content is plain text), and that a blank line separates the header area and body area. --MYBOUNDARY Content-Type: application/json { "ExampleMessage": "This is the body area of the second body part.", "Notes": [ "Note that the header area of this body part contains a Content-Type header.", "Note that the header area and the body area are separated by a blank line." ] } --MYBOUNDARY Content-Disposition: form-data; name="anExample"; filename="sample.rtf" Content-Type: application/rtf {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}} {\*\generator Riched20 10.0.16299}\viewkind4\uc1 \pard\sa200\sl276\slmult1\f0\fs22\lang9 This is a sample RTF document. Note that in this body part, we have specified a \i Content-Disposition\i0 header. This header allows for additional useful information to be passed to the recipient, such as the filename of the document. At this end of this body part, we mark the end of the multipart request.\par } --MYBOUNDARY-- ``` -------------------------------- ### Get Channel Instances Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/channel/actions/instances.html Retrieves a list of all currently running channel instances. This endpoint provides details about each active channel, such as its unique identifier, when it started, the last message sent, and the total number of messages transmitted. ```APIDOC ## GET channels/instances ### Description Retrieves a list of currently running channel instances. ### Method GET ### Endpoint /channels/instances ### Response #### Success Response (200) A list of currently running channel instances. Each instance includes: - **Id** (string): The unique identifier of the channel instance. - **StartTime** (string): The timestamp when the channel instance started. - **LastMessageSentTime** (string): The timestamp of the last message sent by this instance. - **MessagesSent** (integer): The total count of messages sent by this instance. - **Links** (object): Contains links related to the channel instance, including a 'Request' link. ### Response Example ```json [ { "Id": "68a18a51-557c-4ade-8eef-af262899f159", "StartTime": "2014-07-22T14:00:00Z", "LastMessageSentTime": "2014-07-22T14:00:00Z", "MessagesSent": 5, "Links": { "Request": "https://myserver/piwebapi/streams/I1AbEDqD5loBNH0erqeqJodtALAaqQoQHk26BGgMQAVXYR0Ag8rvbPp_xUEC80vMunHcq2g/channel" } }, { "Id": "1f666090-944e-4e17-9e37-02c5f7baed5d", "StartTime": "2014-07-22T14:00:00Z", "LastMessageSentTime": "2014-07-22T14:00:00Z", "MessagesSent": 7, "Links": { "Request": "https://myserver/piwebapi/streams/I1AbxUEC80vMunHcq2gqJodtALAtcdBko_F5xGTpFCaTFd2TwRQESrwf1o0iQUMxYbzNaDg/channel" } } ] ``` ``` -------------------------------- ### GET system/configuration Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/configuration/actions/listconfiguration.html Use this endpoint to retrieve the current system configuration. All configurations are returned, regardless of their active status. ```http GET system/configuration ``` -------------------------------- ### System Landing Sample Response Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/system/actions/landing.html This is a sample JSON response body for the System Landing endpoint. It provides details about the PI Web API product and version, along with links to other system-related resources such as cache instances, configuration, user info, versions, status, and instance configuration. ```json { "ProductTitle": "PI Web API 2019 SP1", "ProductVersion": "1.13.0.6298", "Links": { "Self": "https://myserver/piwebapi/system", "CacheInstances": "https://myserver/piwebapi/system/cacheinstances", "Configuration": "https://myserver/piwebapi/system/configuration", "UserInfo": "https://myserver/piwebapi/system/userinfo", "Versions": "https://myserver/piwebapi/system/versions", "Status": "https://myserver/piwebapi/system/status", "InstanceConfiguration": "https://myserver/piwebapi/system/instanceconfiguration" } } ``` -------------------------------- ### Sample Response Body for NotificationRuleTemplate Get Source: https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/notificationruletemplate/actions/get.html This is an example of the JSON response body when successfully retrieving a notification rule template. It includes details such as WebId, Id, Name, Description, Path, and various configuration properties of the template. ```json { "WebId": "I1NTDqD5loBNH0erqeqJodtALAtdcX5JH_5xGEKAAVXTSaAg", "Id": "e9a984d0-f47c-11e7-8454-00155d029708", "Name": "MachineName", "Description": "Description entered by the user", "Path": "\\MyAssetServer\MyDatabase\CityName\ElementTemplates[Template3]\NotificationRuleTemplates[Notification Rule Template]", "CategoryNames": [ "MachineNameAlerts" ], "Criteria": "Name: EventFrameCriteriaName", "MultiTriggerEventOption": "HighestSeverity", "NonrepetitionInterval": "PT3S", "ResendInterval": "PT5S", "Status": "Functioning", "TemplateName": "MachineName Notification Rule Template", "Links": { "Self": "https://localhost.osisoft.int/piwebapi/notificationruletemplates/I1NTDqD5loBNH0erqeqJodtALAtdcX5JH_5xGEKAAVXTSaAg" } } ```