AnsweredAssumed Answered

PI WebAPI Batch CTP question

Question asked by arosenthal on Apr 11, 2016
Latest reply on Apr 14, 2016 by arosenthal

I am trying to write a batch query for the PI WebAPI that gets a specific PI server and then uses the "Points" link to get the PI points in that server. My initial query works fine:

 

{
 "GetPIServer": {
   "Method": "GET",
   "Resource": "https://localhost/piwebapi/dataservers?path=\\\\DEV_PI"
 },
 "GetPoints": {
   "Method": "GET",
   "Resource": "$.GetPIServer.Content.Links.Points",
   "ParentIds": [
     "GetPIServer"
   ]
 }
}

 

However, if I want to restrict the number of points it returns by using the "maxCount" parameter, like this:

 

{
 "GetPIServer": {
   "Method": "GET",
   "Resource": "https://localhost/piwebapi/dataservers?path=\\\\DEV_PI"
 },
 "GetPoints": {
   "Method": "GET",
   "Resource": "$.GetPIServer.Content.Links.Points?maxCount=100",
   "ParentIds": [
     "GetPIServer"
   ]
 }
}

 

Then I get the following error in the response back:

 

Invalid resource: $.GetPIServer.Content.Links.Points?maxCount=100

 

Is there a way to accomplish this using JSONPath? Perhaps a string concatenation operator of some kind...

Outcomes