Programming in PI Web API

Learn how to retrieve and manipulate time series data , asset information and even 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. Generic HTTP web request knowledge will not be taught in this course.

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 configurational and security items.
  • Locate the PI Web API Programmers’ Reference and utilize the Help files to develop queries necessary for your application
  • Leverage URL parameters to specify your query with reference to the Help Documentation for valid parameters
  • 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
  • Identify and Utilize Debugging tools to troubleshoot your own code
  • Identify improvements that can be cumulatively applied to improve code/HTTP request performance and readability

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

Level: Introductory

Time: 20 hours

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 of Fiddler is beneficial, but not required. Knowledge of RESTful Web Services and Web API’s is valuable, but also not required.
  •  If you don’t feel comfortable with above the following links provide some introductory information on the necessary background in order to take this course:

Price: 

  • 259 USD: By signing up for this course you will have access to:
    • OSIsoft Engineers who can review your final project
    • Sharable certificate of completion that can be directly posted on LinkedIn (*To obtain the certificate of completion, you need to pass the final project.)

You can also audit the video lecture content on the OSIsoft Learning YouTube Channel. This does not include the exercises, supplementary readings, graded final project or certificate of completion. 

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
  • 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
  • Fiddler (v. 2.x)

If you do not have access to your own PI System, subscribe to the optional Training Cloud Environment to work with the "PI System Clients - Cloud Environment" :

Grading and Certification of Completion: 

Once you register for this course, you must select one of the final submission review periods below. During this period, our course facilitators will be available to review and grade your project. If you don't receive a passing grade in the first submission, you can re-submit your work again during the 1 week review period.

Final Project Submission Deadline

Event Date Spaces left
Programming in PI Web API (Final Project Due) - Virtual Dec. 2, 2019, midnight -
Dec. 6, 2019, 4 p.m. PST
33

Course Outline

  • Getting Started
  • Key Course Information
  • Course Grading Scheme
  • Final Project Submission Deadline
  • How to Navigate This Course
  • Offline Course Videos for Blocked YouTube Users
  • Lesson 1 - Introduction to PI Web API
  • What is PI web API ? Why is it important?
  • Knowledge Check: Intro
  • Make PI Web API queries in a web browser
  • Knowledge Check: Browser
  • Solution: Browser
  • Lesson 2 - Where to get HELP
  • Use the PI Web API help files
  • Knowledge Check: PI Web API Help Files
  • Solution: PI Web API Help Files
  • Lesson 3 - WebIDs
  • Introduction to WebIDs
  • Knowledge Check: PI Web API WebIds
  • Solution: PI Web API WebIds
  • Create and Translate WebIDs v2.0
  • Knowledge Check: WebId v2.0
  • Solution: WebId v2.0
  • Lesson 4 - Working with Fiddler
  • Make GET requests using Fiddler
  • Add or delete PI points using POST requests
  • Knowledge Check: Using non-browser HTTP Clients
  • Solution: Using non-browser HTTP Clients
  • Lesson 5 - Batch Controller
  • Make multiple independent sub-requests with the batch controller
  • Make parent-child requests using the batch controller
  • Apply request templates with the batch controller
  • Knowledge Check: Batch Controller
  • Solution: Batch Controller
  • Lesson 6 - Search and Filters
  • Searching and filtering objects in PI Web API
  • Knowledge Check: AF Search
  • Solution: AF Search
  • Lesson 7 - Real-time Updates
  • Collect real-time changes from PI Web API with channels
  • Collect real-time changes using stream updates (recommended)
  • Knowledge Check: Stream Updates
  • Solution: Stream Updates
  • Lesson 8 - 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
  • Final Project
  • Final Project
  • Course Evaluation
  • How did it go?
  • Next Steps
  • Additional Resources

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. Generic HTTP web request knowledge will not be taught in this course.

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 configurational and security items.
  • Locate the PI Web API Programmers’ Reference and utilize the Help files to develop queries necessary for your application
  • Leverage URL parameters to specify your query with reference to the Help Documentation for valid parameters
  • 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
  • Identify and Utilize Debugging tools to troubleshoot your own code
  • Identify improvements that can be cumulatively applied to improve code/HTTP request performance and readability

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

Level: Introductory

Time: 20 hours

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 of Fiddler is beneficial, but not required. Knowledge of RESTful Web Services and Web API’s is valuable, but also not required.
  •  If you don’t feel comfortable with above the following links provide some introductory information on the necessary background in order to take this course:

Price: 

  • 259 USD: By signing up for this course you will have access to:
    • OSIsoft Engineers who can review your final project
    • Sharable certificate of completion that can be directly posted on LinkedIn (*To obtain the certificate of completion, you need to pass the final project.)

You can also audit the video lecture content on the OSIsoft Learning YouTube Channel. This does not include the exercises, supplementary readings, graded final project or certificate of completion. 

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
  • 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
  • Fiddler (v. 2.x)

If you do not have access to your own PI System, subscribe to the optional Training Cloud Environment to work with the "PI System Clients - Cloud Environment" :

Grading and Certification of Completion: 

Once you register for this course, you must select one of the final submission review periods below. During this period, our course facilitators will be available to review and grade your project. If you don't receive a passing grade in the first submission, you can re-submit your work again during the 1 week review period.

Live events

Final Project Submission Deadline

Event Date Spaces left
Programming in PI Web API (Final Project Due) - Virtual Dec. 2, 2019, midnight -
Dec. 6, 2019, 4 p.m. PST
33

Course Outline

  • Getting Started
  • Key Course Information
  • Course Grading Scheme
  • Final Project Submission Deadline
  • How to Navigate This Course
  • Offline Course Videos for Blocked YouTube Users
  • Lesson 1 - Introduction to PI Web API
  • What is PI web API ? Why is it important?
  • Knowledge Check: Intro
  • Make PI Web API queries in a web browser
  • Knowledge Check: Browser
  • Solution: Browser
  • Lesson 2 - Where to get HELP
  • Use the PI Web API help files
  • Knowledge Check: PI Web API Help Files
  • Solution: PI Web API Help Files
  • Lesson 3 - WebIDs
  • Introduction to WebIDs
  • Knowledge Check: PI Web API WebIds
  • Solution: PI Web API WebIds
  • Create and Translate WebIDs v2.0
  • Knowledge Check: WebId v2.0
  • Solution: WebId v2.0
  • Lesson 4 - Working with Fiddler
  • Make GET requests using Fiddler
  • Add or delete PI points using POST requests
  • Knowledge Check: Using non-browser HTTP Clients
  • Solution: Using non-browser HTTP Clients
  • Lesson 5 - Batch Controller
  • Make multiple independent sub-requests with the batch controller
  • Make parent-child requests using the batch controller
  • Apply request templates with the batch controller
  • Knowledge Check: Batch Controller
  • Solution: Batch Controller
  • Lesson 6 - Search and Filters
  • Searching and filtering objects in PI Web API
  • Knowledge Check: AF Search
  • Solution: AF Search
  • Lesson 7 - Real-time Updates
  • Collect real-time changes from PI Web API with channels
  • Collect real-time changes using stream updates (recommended)
  • Knowledge Check: Stream Updates
  • Solution: Stream Updates
  • Lesson 8 - 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
  • Final Project
  • Final Project
  • Course Evaluation
  • How did it go?
  • Next Steps
  • Additional Resources