Hello and welcome to the course "Using PI Web API from beginner to advanced". My name is Vincent
Partusch and I'm a member of the support team for OSIsoft's developer technologies. In this course
we'll be covering the core functionality of the PI Web API and practice using that
functionality with a variety of tools. Just as importantly we'll become familiar with the
Web API documentation so that you know how to find the information you need going forward.
There are some topics to point out that will not be covered in this class. The OMF endpoint that
was added for PI Web API in the 2019 version is the preferred way of writing time series data
moving forward, it is an important topic that deserves more attention than we would be able
to give it in this course. Additionally the PI Web API index search will not be
covered but we will look at alternative ways of searching within the PI Web API. Finally I want
to highlight the general programming practices are not going to be covered and the intent of
the code examples are just to demonstrate PI Web API functionality as simply as possible.
So what is the PI Web API? PI Web API is a restful web service that provides programmatic access to
the PI system via HTTP requests. It's an asp.net Web API and the underlying data access is provided
by the AF SDK. REST is a common architectural style for modern web services adhering to REST
principles in the context of PI Web API means that we have a client-server architecture,
the connections are stateless so PI Web API maintains no observable knowledge of clients
across request, each request's an independent transaction between the client and the server,
interaction with the PI Web API is organized around resources.
Most importantly PI and AF objects such as asset servers, data servers, points,
elements, attributes, event frames and so on map onto resources in the PI Web
API and it is navigable by links. So in each response from the server you will
get a set of links to related objects, for example an object return for an AF element
would contain links to the attributes for that element this makes it easy for
a client to quickly navigate between related resources. This slide shows an overview of
the three main developer technology OSIsoft provides for interacting with the PI system.
The PI Web API as mentioned is a web service that allows programmatic access for any platform or
language that supports making HTTP requests. The PI Web API itself uses AF SDK for data
access so it's functionality is by definition a subset of what AF SDK provides. This also means
that it's not possible for PI Web API to have better performance in AF SDK, however for many
applications performance difference is small and the PI Web API is much more flexible in terms of
which platforms and languages can be used. AF SDK itself is a .NET library that provides the
broadest functionality of any of our developer technologies and has the best performance. The
main downside that is is that it's limited to .NET only and Windows operating system only.
The third option is our set of PI SQL products which expose the PI System as a relational
database via several widely used standards. This makes it easy to integrate with other
software that supports those standards and allow for people to with a SQL background to
easily retrieve data. However there are limited features when compared to the other two options,
for example all AF server access is read-only. This course is designed to
start simple and gradually move on to more advanced features within the Web API. We'll
begin by making simple read requests through a web browser and then move on to making
requests that actually change data within the PI System using a tool called postman.
The last few exercises we use Python scripts to do some more advanced tasks like generating
web IDs client-side, executing batch requests and signing up for streaming updates. We'll finish by
taking a look at the samples on the OSIsoft github and wrapping up with a final exam.
I hope you learn a lot and enjoy the course.