PIWebAPI BATCH using Postman

PIWebAPI BATCH using Postman

PIWebAPI is the API endpoint to access PI System. It provides an easy way to access PI System. It is possible to notice, after some time dealing with PIWebAPI, that creating a query can be very challenger. Passing a lot of parameters, passing WebID needed and getting results from another queries will turn into a very complex task.

PIWebAPI BATCH request is a very useful controller that can handle multiple requests to PI System. It is very useful to build a query avoid using WebIDs. To perform such a query it is possible to use Postman. Postman is a API client where is possible to organize API queries and it can be downloaded at this link: https://www.postman.com/downloads/.

To use BATCH mechanism in Postman, create a POST request against https://<PISERVERNAME>/piwebapi/batch/. fill in the authorization needed and add Content-Type "application/json; cherset=UTF-8" on Headers

No alt text provided for this image

BATCH mechanism should be specified at Request's Body. In the example bellow there is a batch request to get Event Frames that are currently "In Progress", given a start time and and Element Path.

No alt text provided for this image

As noticed, there is no need to use hard coded WebIDs on this request if using the batch mechanism. Each query works as a step sequence for the other.

Postman allow postman variables usage, identified by double brace {{VariableName}}. These variables are defined at pre-request Script.

No alt text provided for this image

It is possible to find a simple AF Tree-view and a simple Postman Collection example at the github repository below. This specific Postman Collection contains several of the main batch requests to deal with AFTables, AFDatabase, Elements, Attributes, Values and Event Frames. You can check and import to your Postman accessing it from the following github address:

https://github.com/pscampos/PIWebAPIBATCHPostman

Import the PISERVER.postman_collection.json json file to your Postman app as shown below.

No alt text provided for this image



Davidson Lima

Tech Lead | PIMS | AVEVA OSIsoft PI System | AI & ML | White Belt

2 年

Good tip, Pedro! I just added this one on my favorite list!

Luciano Vasconcelos Filho

Engenheiro de dados e professor da Jornada

2 年

thanks for sharing

Luan Sandes

Manager, Data Intelligence & Analytics | AVEVA/OSIsoft PI SME

2 年

Saved for reference! Thanks Pedro.

要查看或添加评论,请登录

Pedro Souza Campos的更多文章

  • Export all PI Vision tables to Excel

    Export all PI Vision tables to Excel

    PI Vision has three native table options: Table, Asset Comparison Table, and Event Frame Table. The "Export to Excel"…

    4 条评论
  • Time Series Data Table for Multiple Attributes

    Time Series Data Table for Multiple Attributes

    A Time Series Data Table is a table capable to display the time series values of an attribute within the Pi Vision time…

    9 条评论
  • Dynamic Calculated Control Limits for Control Chart on PI System

    Dynamic Calculated Control Limits for Control Chart on PI System

    Control Chart is a tool used to analyze data over time. It is possible to identify if process is predictable analyzing…

    9 条评论
  • PROD-DEV Environment Management

    PROD-DEV Environment Management

    Critical operations, new deploys, and new developments can impact significantly the system stability. IT teams used to…

    3 条评论
  • High-Performance HMI concepts applied to PI Vision

    High-Performance HMI concepts applied to PI Vision

    ANSI/ISA-101.01-2015 Human Machine Interfaces for Process Automation Systems is a Standard for HMI creation.

    10 条评论
  • PI Point Analysis Output Traceability

    PI Point Analysis Output Traceability

    PI Analysis is a PI AF tool that allows users to create calculations and save the output calculation into PI Points to…

    2 条评论
  • PI Vision Manual Data Entry

    PI Vision Manual Data Entry

    Inserting manual data into the PI System is a very common request. This can be done properly through PI Manual Logger.

    8 条评论
  • PI AF Asset Structuration

    PI AF Asset Structuration

    PI AF is a PI System layer that shows a tree view representing all mill assets. It also permits the creation of other…

社区洞察

其他会员也浏览了