To get started you could go to the WebAPI URL and browse through the AFmodel. The URL in your browser shows you the call to make.
That leaves the issue of the WebID. They should be faily constant if your AFmodel stays the same, but you would need some process to first derive WebID's from your AF attributes before making the calls to get the data.
A slightly better source of documentation over the helpfile is to be found here: https://techsupport.osisoft.com/Documentation/PI-Web-API/help/getting-started.html
Hi Roger, thanks for thinking with me.
The url you gave contains the same information as the PI WebAPI helpfile, which you get when the PI WebAPI is installed.
There are only bits of explanation in the helpfiles of how it works. But no exact directions for example for the case I described.
Most of the examples go in to detail of how to get elements from AF. What I want to do is get data from PI points and the examples are limited or I did not find them yet.
2 of 2 people found this helpful
We have a lot of great information here on PI Square that should be able to help - this post here is sort of an index of a lot of this information: PI Web API Useful Links Nexus
In there you'll find a few "getting started" guides, as well as code samples, and some larger scale example projects
I'd additional recommend working through our free Programming in PI Web API course here on PI Square, although, admittedly, it does focus more on retrieving data from AF than direct from a PI Data Archive.
Now, to more specifically answer your question I'd recommend checking out this guide: PI Web API: Quick Start
In the section titled "Example: Make a Request" you'll see a specific example about getting the value directly from a PI tag by using the Stream endpoints. You'll see that the GetValue method is called by using the .../Value URL endpoint once you've identified the PI tag's WebID
1) Query the stream and capture the WebID in the JSON response:
2) Use the WebID to return the value: