Using PI Web API from Beginner to Advanced

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

About this course

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.

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

Developers and programmers looking to leverage HTTP Web Requests to build applications for the PI System

Level: Intermediate

Study Time: 24 hours

Course Access: Unlimited access. The only exception is the Training Cloud Environment for which you have 30 day access. After those 30 days you can purchase additional access with one of the two options below:

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:

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

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

You can audit the full video lecture content right now on the OSIsoft Learning YouTube Channel

Course Outline

  • Getting Started
  • Key Course Information
  • Course Grading Scheme
  • Offline Course Videos for Blocked YouTube Users
  • 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
  • [POLL] Who's from what industry
  • 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
  • End of the course

About this course

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.

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

Developers and programmers looking to leverage HTTP Web Requests to build applications for the PI System

Level: Intermediate

Study Time: 24 hours

Course Access: Unlimited access. The only exception is the Training Cloud Environment for which you have 30 day access. After those 30 days you can purchase additional access with one of the two options below:

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:

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

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

You can audit the full video lecture content right now on the OSIsoft Learning YouTube Channel

Course Outline

  • Getting Started
  • Key Course Information
  • Course Grading Scheme
  • Offline Course Videos for Blocked YouTube Users
  • 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
  • [POLL] Who's from what industry
  • 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
  • End of the course