AnsweredAssumed Answered

PIwebAPI Batch Request reuse tow Attributes in Request Template

Question asked by ChristopherWeh on Jul 31, 2018
Latest reply on Jul 31, 2018 by Marcos Vainer Loeff

Hello together,

I am trying to build up a batch request to retrieve EventFrame data:

 

{

  "EventFrames":{

      "Method": "GET",

      "Resource": "https://server.com/piwebapi/elements/webid/eventframes?starttime=*-7d&endtime=*-&selectedFields=Items.WebId;Items.StartTime;Items.EndTime;Items.Links.Value"

   },

   "Data":{

    "Method":"GET",

    "RequestTemplate":{

    "Resource":"https://server.com/piwebapi/streamsets/recorded?webid=Pwebid1&webid=webid2&starttime={0}&endtime={1}"

    },

    "Parameters":[

    "$.EventFrames.Content.Items[*].StartTime",

    "$.EventFrames.Content.Items[*].EndTime"

    ],

    "ParentIds":[

    "EventFrames"

    ]

   }

}

 

When I run this request I get the following error message:

More than one JSON path selected multiple tokens: $.EventFrames.Content.Items[*].StartTime, $.EventFrames.Content.Items[*].EndTime

 

When I replace the wildcard character * in the parameter section with a number it works perfectly. Is there a possibility to use two attributes of the items in the request template? I tried several modifications, but couldn't figure it out how to do it.

 

Regards,

Christopher

Outcomes