-
Re: webapi Error on Element value Adhoc calls
bshangMar 11, 2016 10:07 PM (in response to jramirez)
Hi Jaime,
This is because AdHoc requires an attribute webId.
The non-adhoc call streamsets/{elementWebId}/value will get all attributes for that element.
The "adhoc" endpoint allows specifying attributes that do not share the same parent, and therefore, each attribute must be passed in the URL parameter as they cannot be inferred. The attribute webId will beging with an "A".
-
Re: webapi Error on Element value Adhoc calls
jramirez Mar 13, 2016 5:38 PM (in response to bshang)Hi Barry:
Thanks for your answer, Then how can I read a number of elements at the same time in a single call?
Jaime
-
Re: webapi Error on Element value Adhoc calls
pthiviergeMar 14, 2016 12:13 PM (in response to jramirez)
Hello Jaime,
Then how can I read a number of elements at the same time in a single call?
You'll need to make a search to get all attributes you need. Then you can keep this list in the cache of your application. Each time you need to query these attributes you can use their ID that are cached in your application.
So you will need at least two calls, the first to get the attributes WebId you need. The second to make your data call.
Hope this helps.
-
Re: webapi Error on Element value Adhoc calls
gregorMar 14, 2016 1:25 PM (in response to pthivierge)
Hello Jaime,
To complement Patrice's answer the call to PI Web API to retrieve StreamSets for multiple unrelated webID's (Attributes) is as follows:
https://<piwebapihost>/piwebapi/streamsets/value?webid=<webID1>&webid=<webID2>&webid=<webID3>
-
Re: webapi Error on Element value Adhoc calls
jramirez Mar 15, 2016 7:53 PM (in response to gregor)Guys:
You have been VERY helpful. The webapi documentation is VERY confusing....May I have a sample call for the GetRecordedAtTimeAdHoc, GetRecordedAtTime, GetRecorded, GetRecordedAdHoc showing hot to specify the time values?
I have been using fiddler to get values and getting all sort of weird errors.
I need to get the value of an element and its atttibutes at a precise time and also for a time span.
THANKS IN ADVANCE FOR YOUR HELP!!!!
Jaime
-
Re: webapi Error on Element value Adhoc calls
bshangMar 15, 2016 10:14 PM (in response to jramirez)
1 of 1 people found this helpfulFor GetRecordedAtTime, the call is
streamsets/recordedattime?webid=<webID1>&webid=<webID2>&webid=<webID3>&time=timeString
See https://techsupport.osisoft.com/Documentation/PI-Web-API/help/topics/time-strings.html for examples of timeStrings. As mentioned here, the time string can be "PI Time" or be parsed by .NET's DateTime.TryParse.
Since there are many time string formatting options, in practice, it is probably best to use a standard such as ISO 8601
ISO 8601 - Wikipedia, the free encyclopedia
Standard Date and Time Format Strings (see RoundTrip format specifier "o") 'yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK'
and to stick with UTC (ends with Z). E.g.
2016-03-13T04:50:31Z
-
-
-
-
-