Unfortunately, we are experiencing an issue with our multiple-user registration functionality.

At this time, we suggest you register individuals one at a time for a class.

If you're experiencing recurring issues, we're here to help at: AVEVATraining@aveva.com

Our IT team is currently working on this issue. We will update you once the problem has been resolved.

Please accept our apologies for the inconvenience caused.

Using PI Web API from Beginner to Advanced

Learn how to retrieve and manipulate time series data , asset information and event frames using PI Web API.

rate limit

Code not recognized.

About this course

The goal of this course is to expose students to the capabilities of the PI Web API by getting them familiar with navigating the documentation and making requests. After taking this lab, students should understand:

   1)    How to navigate through various endpoints in a web browser

   2)    How to make requests through a non-browser HTTP client

   3)    How to interact with the PI Web API programmatically

By the end of the course, you will be able to:

  • Understand the common use cases of Web API and determine if it is the correct tool for your use case.
  • Comfortably utilize the PI Web API in a browser to navigate to specific elements, attributes, and points as well as certain configuration and security items.
  • Locate the PI Web API Programmers Reference and utilize the Help files to develop queries necessary for your application.
  • Specify URL parameters in your query to control 
  • Create, Edit, and Delete AF Elements, AF Attributes, and PI Points.
  • Leverage the Batch Controller endpoint to make multiple dependent sub-requests and dynamically create requests based on previous sub-request responses.
  • Perform basic AF Search Queries via the PI Web API to filter for event Frames, Elements, and Attributes of interest.
  • Retrieve incremental real-time updates via the Stream Updates and/or Channels features.
  • Identify and resolve issues with making cross-origin requests by properly setting Cross-Origin Resource Sharing (CORS) and Cross-Site Forgery Request (CSRF) Defense Settings in the PI Web API.

Audience

This course is aimed for developers and programmers looking to leverage HTTP Web Requests to build applications for the PI System. It is for someone who needs to understand how to interact with the PI System using RESTful Web Services and develop HTTP requests to retrieve the necessary information.

Level: Intermediate

Study Time: 24 hours

Course Access: Unlimited access to all content except the Training Cloud Environment (TCE). You have 30 days access to the TCE starting on the day you access module section "Launch Cloud Environment". 

After those 30 days you can purchase additional access with one of the two options below:

This Course Includes...

  • Videos, exercises and quizzes to help you learn the material
  • A Cloud Environment accessible for 30 days and configured to complete all the exercises in the course
  • Shareable certificate of completion.
  • This course is self-paced for your convenience. Thus, there are no live components to the course, nor are there required login hours. Please use the video lectures for instruction along with the course exercises to gain hands-on experience working with key concepts.
  •  There are 10 hands-on exercises tailored to apply the knowledge you've learned in the video lectures, followed by a Final Exam.
  • Once you register for a course, you will have access to the course materials 24/7 on this website.

Prerequisites

  • This course does not teach programming, but rather how to use the PI Web API within your business. Developers should have basic knowledge of HTTP requests and JSON syntax, though we will cover some of these concepts as well.
  • Basic knowledge of the PI System generally is required for this course. Concepts such as PI Asset Framework and the relationship of attributes and elements to PI Points/Tag on the Data Archive should be familiar and comfortable before beginning this course.
  • Knowledge and use of developer tools in modern browsers as well as either Postman is beneficial, but not required. Knowledge of RESTful Web Services and Web API's is valuable, but also not required.
  • The programming exercises in this course use Python. They are intended to be simple enough that someone with minimal knowledge of Python can still complete them, but some familiarity with general programming concepts is required.
  • If you don't feel comfortable with the above the following links provide some introductory information on the necessary background in order to take this course:

Software Requirements

In order to follow along with the videos and complete the exercises, learners will need:

  • PI System
    • PI Data Archive that is running and collecting data.
    • PI Asset Framework with write access to an AF Database
    • The "NuGreen" sample AF database installed on your development environment. The database can be downloaded from this lesson, and imported into your AF server by using PI System Explorer. First, create a new database, then use file > import.
  • PI Web API v2018 or newer
    • Membership to the PI Web API Administrators local Windows Group on the machine where the PI Web API service is installed
  • Google Chrome (v. 70.0.3538 or newer), Firefox (v. 60.0 or newer), or Microsoft Edge (v. 42.17134 or newer)
    • This course is taught utilizing Google Chrome for Developer tools and is the preferred browser for the course, though not required
  • Postman

* If you do not have access to a PI System you can use the included Training Cloud Environment. Go to the Training Cloud Environment section at the end of the course to learn more about it and deploy your cloud environments.

Further Information

  • This is a self-paced course. Any questions or assistance needed about the material can be asked in this course's space in the OSIsoft PI Square community
  • When you complete the examination at the end of the course, you will receive a certificate of completion which can be shared and directly posted on LinkedIn.

For more information about our Online Courses please visit our FAQ page

  • There are two important plugins for the PI Web API that we will not be covered in this class: the OMF endpoint and Indexed Search.
    • OMF Endpoint - The OSIsoft Message Format (OMF) defines a format for data messages that can be read by compliant OSIsoft products. The OMF (OSIsoft Message Format) endpoint was added to PI Web API in the 2019 release and will be the primary method for OMF data ingress to the PI System going forward. When writing large amounts of data through PI Web API it is recommended to use the OMF endpoint, as it was designed specifically for data ingress. If you are interested in learning about OMF and how to develop applications against the PI Web API implementation, please see the Developers Companion Guide: https://explore.osisoft.com/omf/os-isoft-message-for
    • Indexed Search - PI Indexed Search and PI Indexed Search Crawler are optional features of PI Web API. The indexed search runs as part of PI Web API, while the Search Crawler is an independent service. The Search Crawler service gathers metadata from the PI System and provides items for the Indexed Search for indexing. The pros/cons of searching with Indexed Search are covered in Section 4, but we will focus on other methods of searching and will not discuss configuring the Search Crawler service.

Course Material

Course Outline

  • Getting Started
  • How to Navigate This Course
  • Discussion Forum
  • Offline Course Videos for Blocked YouTube Users
  • Course Workbook
  • Training Cloud Environments
  • Cloud Environments Introduction
  • Architecture for this Course
  • Cloud Environments Instructions
  • Launch Cloud Environment
  • Lesson 1 - Introduction to PI Web API
  • Welcome to the Course
  • What is the PI Web API?
  • Make PI Web API queries in a web browser
  • Exercise 1: Exploring the PI Web API
  • Exercise 1 Solution
  • Lesson 2 - PI Web API Basics
  • Controllers
  • Methods
  • URL Query Parameters
  • Generalized URL Format
  • Documentation Example
  • Use the PI Web API help files
  • Exercise 2: Using URL Query Parameters
  • Exercise 2 Solution
  • Lesson 3 - Constructing PI Web API Requests
  • HTTP Verbs
  • Headers
  • Request Body
  • Exercise 3: Make Requests in Postman
  • Exercise 3 Solution
  • Lesson 4 - Searching with PI Web API
  • Three ways to Search
  • Traditional endpoints with filters
  • Using the Search controller
  • Using the AFSearch methods
  • Benefits of the AFSearch methods
  • Searching and filtering objects in PI Web API
  • Exercise 4: Searching in PI Web API
  • Exercise 4 Solution
  • Lesson 5 - WebId 2.0
  • WebId Types
  • Example of Full WebId components
  • Introduction to WebIDs
  • Create and Translate WebIDs v2.0
  • Python Environment Walkthrough
  • Exercise 5a: Decode WebIds
  • Exercise 5a Solution
  • Exercise 5b: Generate a WebId
  • Exercise 5b Solution
  • Lesson 6 - Batch Requests
  • What are Batch Requests?
  • Structure of a Batch request
  • Parent-Child requests
  • JSONPath
  • Example parent-child Batch request
  • Make multiple independent sub-requests with the batch controller
  • Make parent-child requests using the batch controller
  • Apply request templates with the batch controller
  • Exercise 6a: Get System Endpoints
  • Exercise 6a Solution
  • Exercise 6b: Create AF Hierarchy
  • Exercise 6b Solution
  • Lesson 7 - Channels
  • Web Sockets
  • Collect real-time changes from PI Web API with channels
  • Channel Query Parameters
  • Exercise 7: Using Channels
  • Exercise 7 Solution
  • Lesson 8 - Stream Updates
  • Registering for updates
  • Retrieving updates
  • Collect real-time changes using stream updates (recommended)
  • Exercise 8: Using Stream Updates
  • Exercise 8 Solution
  • Lesson 9 - Security, Best Practices & Troubleshooting Tips
  • Configuring Cross-Origin Resource Sharing (CORS)
  • Using PI Web API Securely
  • Best Practices and Performance Improvements for PI Web API Requests
  • General PI Web API Troubleshooting Tips
  • Lesson 10 - OSIsoft GitHub
  • Final Exercise using GitHub Samples
  • Final Exam
  • Final Exam
  • Course Evaluation
  • How did it go?
  • Next Steps
  • Additional Resources
  • Optional: Make GET requests using Fiddler

About this course

The goal of this course is to expose students to the capabilities of the PI Web API by getting them familiar with navigating the documentation and making requests. After taking this lab, students should understand:

   1)    How to navigate through various endpoints in a web browser

   2)    How to make requests through a non-browser HTTP client

   3)    How to interact with the PI Web API programmatically

By the end of the course, you will be able to:

  • Understand the common use cases of Web API and determine if it is the correct tool for your use case.
  • Comfortably utilize the PI Web API in a browser to navigate to specific elements, attributes, and points as well as certain configuration and security items.
  • Locate the PI Web API Programmers Reference and utilize the Help files to develop queries necessary for your application.
  • Specify URL parameters in your query to control 
  • Create, Edit, and Delete AF Elements, AF Attributes, and PI Points.
  • Leverage the Batch Controller endpoint to make multiple dependent sub-requests and dynamically create requests based on previous sub-request responses.
  • Perform basic AF Search Queries via the PI Web API to filter for event Frames, Elements, and Attributes of interest.
  • Retrieve incremental real-time updates via the Stream Updates and/or Channels features.
  • Identify and resolve issues with making cross-origin requests by properly setting Cross-Origin Resource Sharing (CORS) and Cross-Site Forgery Request (CSRF) Defense Settings in the PI Web API.

Audience

This course is aimed for developers and programmers looking to leverage HTTP Web Requests to build applications for the PI System. It is for someone who needs to understand how to interact with the PI System using RESTful Web Services and develop HTTP requests to retrieve the necessary information.

Level: Intermediate

Study Time: 24 hours

Course Access: Unlimited access to all content except the Training Cloud Environment (TCE). You have 30 days access to the TCE starting on the day you access module section "Launch Cloud Environment". 

After those 30 days you can purchase additional access with one of the two options below:

This Course Includes...

  • Videos, exercises and quizzes to help you learn the material
  • A Cloud Environment accessible for 30 days and configured to complete all the exercises in the course
  • Shareable certificate of completion.
  • This course is self-paced for your convenience. Thus, there are no live components to the course, nor are there required login hours. Please use the video lectures for instruction along with the course exercises to gain hands-on experience working with key concepts.
  •  There are 10 hands-on exercises tailored to apply the knowledge you've learned in the video lectures, followed by a Final Exam.
  • Once you register for a course, you will have access to the course materials 24/7 on this website.

Prerequisites

  • This course does not teach programming, but rather how to use the PI Web API within your business. Developers should have basic knowledge of HTTP requests and JSON syntax, though we will cover some of these concepts as well.
  • Basic knowledge of the PI System generally is required for this course. Concepts such as PI Asset Framework and the relationship of attributes and elements to PI Points/Tag on the Data Archive should be familiar and comfortable before beginning this course.
  • Knowledge and use of developer tools in modern browsers as well as either Postman is beneficial, but not required. Knowledge of RESTful Web Services and Web API's is valuable, but also not required.
  • The programming exercises in this course use Python. They are intended to be simple enough that someone with minimal knowledge of Python can still complete them, but some familiarity with general programming concepts is required.
  • If you don't feel comfortable with the above the following links provide some introductory information on the necessary background in order to take this course:

Software Requirements

In order to follow along with the videos and complete the exercises, learners will need:

  • PI System
    • PI Data Archive that is running and collecting data.
    • PI Asset Framework with write access to an AF Database
    • The "NuGreen" sample AF database installed on your development environment. The database can be downloaded from this lesson, and imported into your AF server by using PI System Explorer. First, create a new database, then use file > import.
  • PI Web API v2018 or newer
    • Membership to the PI Web API Administrators local Windows Group on the machine where the PI Web API service is installed
  • Google Chrome (v. 70.0.3538 or newer), Firefox (v. 60.0 or newer), or Microsoft Edge (v. 42.17134 or newer)
    • This course is taught utilizing Google Chrome for Developer tools and is the preferred browser for the course, though not required
  • Postman

* If you do not have access to a PI System you can use the included Training Cloud Environment. Go to the Training Cloud Environment section at the end of the course to learn more about it and deploy your cloud environments.

Further Information

  • This is a self-paced course. Any questions or assistance needed about the material can be asked in this course's space in the OSIsoft PI Square community
  • When you complete the examination at the end of the course, you will receive a certificate of completion which can be shared and directly posted on LinkedIn.

For more information about our Online Courses please visit our FAQ page

  • There are two important plugins for the PI Web API that we will not be covered in this class: the OMF endpoint and Indexed Search.
    • OMF Endpoint - The OSIsoft Message Format (OMF) defines a format for data messages that can be read by compliant OSIsoft products. The OMF (OSIsoft Message Format) endpoint was added to PI Web API in the 2019 release and will be the primary method for OMF data ingress to the PI System going forward. When writing large amounts of data through PI Web API it is recommended to use the OMF endpoint, as it was designed specifically for data ingress. If you are interested in learning about OMF and how to develop applications against the PI Web API implementation, please see the Developers Companion Guide: https://explore.osisoft.com/omf/os-isoft-message-for
    • Indexed Search - PI Indexed Search and PI Indexed Search Crawler are optional features of PI Web API. The indexed search runs as part of PI Web API, while the Search Crawler is an independent service. The Search Crawler service gathers metadata from the PI System and provides items for the Indexed Search for indexing. The pros/cons of searching with Indexed Search are covered in Section 4, but we will focus on other methods of searching and will not discuss configuring the Search Crawler service.

Course Material

Course Outline

  • Getting Started
  • How to Navigate This Course
  • Discussion Forum
  • Offline Course Videos for Blocked YouTube Users
  • Course Workbook
  • Training Cloud Environments
  • Cloud Environments Introduction
  • Architecture for this Course
  • Cloud Environments Instructions
  • Launch Cloud Environment
  • Lesson 1 - Introduction to PI Web API
  • Welcome to the Course
  • What is the PI Web API?
  • Make PI Web API queries in a web browser
  • Exercise 1: Exploring the PI Web API
  • Exercise 1 Solution
  • Lesson 2 - PI Web API Basics
  • Controllers
  • Methods
  • URL Query Parameters
  • Generalized URL Format
  • Documentation Example
  • Use the PI Web API help files
  • Exercise 2: Using URL Query Parameters
  • Exercise 2 Solution
  • Lesson 3 - Constructing PI Web API Requests
  • HTTP Verbs
  • Headers
  • Request Body
  • Exercise 3: Make Requests in Postman
  • Exercise 3 Solution
  • Lesson 4 - Searching with PI Web API
  • Three ways to Search
  • Traditional endpoints with filters
  • Using the Search controller
  • Using the AFSearch methods
  • Benefits of the AFSearch methods
  • Searching and filtering objects in PI Web API
  • Exercise 4: Searching in PI Web API
  • Exercise 4 Solution
  • Lesson 5 - WebId 2.0
  • WebId Types
  • Example of Full WebId components
  • Introduction to WebIDs
  • Create and Translate WebIDs v2.0
  • Python Environment Walkthrough
  • Exercise 5a: Decode WebIds
  • Exercise 5a Solution
  • Exercise 5b: Generate a WebId
  • Exercise 5b Solution
  • Lesson 6 - Batch Requests
  • What are Batch Requests?
  • Structure of a Batch request
  • Parent-Child requests
  • JSONPath
  • Example parent-child Batch request
  • Make multiple independent sub-requests with the batch controller
  • Make parent-child requests using the batch controller
  • Apply request templates with the batch controller
  • Exercise 6a: Get System Endpoints
  • Exercise 6a Solution
  • Exercise 6b: Create AF Hierarchy
  • Exercise 6b Solution
  • Lesson 7 - Channels
  • Web Sockets
  • Collect real-time changes from PI Web API with channels
  • Channel Query Parameters
  • Exercise 7: Using Channels
  • Exercise 7 Solution
  • Lesson 8 - Stream Updates
  • Registering for updates
  • Retrieving updates
  • Collect real-time changes using stream updates (recommended)
  • Exercise 8: Using Stream Updates
  • Exercise 8 Solution
  • Lesson 9 - Security, Best Practices & Troubleshooting Tips
  • Configuring Cross-Origin Resource Sharing (CORS)
  • Using PI Web API Securely
  • Best Practices and Performance Improvements for PI Web API Requests
  • General PI Web API Troubleshooting Tips
  • Lesson 10 - OSIsoft GitHub
  • Final Exercise using GitHub Samples
  • Final Exam
  • Final Exam
  • Course Evaluation
  • How did it go?
  • Next Steps
  • Additional Resources
  • Optional: Make GET requests using Fiddler