Exercise 5: Using non-browser HTTP Clients with Fiddler

Document created by Milanez on Jun 1, 2020
Version 1Show Document
  • View in full screen mode

The following should be done using Fiddler, PostMan, or another non-browser application capable of making HTTP requests


1. Retrieve the interpolated data for the CDT158 point every minute for the past two hours


First execute https://localhost/piwebapi/points?path=\\DataArchiveName\CDT158 to get the webid.
Then https://localhost/piwebapi/streams/{webid}/interpolated?startTime=*-2h&endTime=*&interval=1m


2. Retrieve the attributes on the "\\PIAF\Nugreen\Nugreen\Wichita\Cracking Process\Equipment\P-723" element with the value type of double


First execute https://localhost/piwebapi/elements?path=\\AFservername\NuGreen\NuGreen\Wichita\Cracking%20Process\Equipment\P-723 to get the webid.
Then https://localhost/piwebapi/elements/{webid}/attributes?valueType=double


3. Create a new element on the "\\PIAF\Nugreen\Nugreen\Wichita\Cracking Process\Equipment\" path called "P-701" and ensure it has a Template Type of Pump


First execute https://localhost/piwebapi/elements?path=\\AFservername\NuGreen\NuGreen\Wichita\Cracking%20Process\Equipment to get the webid.
Then execute a POST request https://localhost/piwebapi/elements/{webid}/Elements with this request body { "Name": "P-701", "TemplateName": "Pump" }


If not authorized, check this: https://pisquare.osisoft.com/thread/43234-get-403-for-post-request


4. Update the Description of the P-701 Element to say "This is a dummy element"


First execute https://localhost/piwebapi/elements?path=\\AFservername\NuGreen\NuGreen\Wichita\Cracking%20Process\Equipment\P-701 to get the webid.
Then execute a PATCH request https://localhost/piwebapi/elements/{webid} with this request body { "Description": "This is a dummy element" }


5. Delete the "P-701" element


Using the webid from the previous, execute a DELETE request https://localhost/piwebapi/elements/{webid} without a request body