AnsweredAssumed Answered

PI Web API query to expose event frames

Question asked by srikanth.nadikatla on Jul 30, 2019
Latest reply on Aug 16, 2019 by srikanth.nadikatla

Hi ALL, I am trying to create a PI Web API query to retrieve all the open EventFrames in an AF database along with their attributes and attribute values. 

 

POST https://<HostName>/piwebapi/batch HTTP/1.1

User-Agent: Fiddler

Host: <HostName>

Content-Type: application/json

X-requested-With: PIWebAPIBatch

Content-Length: 1026

{

"SourceEventFrames":
{
"Method": "GET",
"Resource": "https://<HostName>/piwebapi/assetdatabases/<WebId>/EventFrames?InProgress=true"
},

"EventFrameAttributes":
{
"Method": "GET",
"ParentIDs": ["SourceEventFrames"],
"RequestTemplate" : {
"Resource": "https://<HostName>/piwebapi/eventframes/{0}/attributes"
},
"Parameters": ["$.SourceEventFrames.Content.Items[*].WebId"]

},

"AttributeValue":
{
"Method": "GET",
"ParentIDs": ["EventFrameAttributes"],
"RequestTemplate" : {
"Resource": "https://<HostName>/piwebapi/attributes/{0}/value"
},
"Parameters": ["$.EventFrameAttributes.Content.Items[*].Content.Items[*].WebId"]
}

}

 

There are couple of questions on this. 1. I've created this in Fiddler (as explained in the PI Web API programming tutorial). How do I consume this in PowerBI or Excel? 2. Can we optimize the query to retrieve only event frame names and attribute details? For Example, We just need WebId in 'sourceeventframes' above, but there is lot of other information we are retrieving such as 'IsAnnotated', 'IsLocked', 'Isacknowledged', etc..

 

Regards,

Srikanth

Outcomes