1 Reply Latest reply on Feb 2, 2018 4:48 PM by vkaufmann

    How to retrieve a value for a point at a certain time using Web API?

    hulley-ats

      Hey there, how would I get the value for a point at a certain time?

       

      In the Web API documentation, they recommend using AtOrAfter, AtOrBefore, etc. but I'm not sure how I would use this in a request or URL.

       

      https://serv/piwebapi/{webId}/value?AtOrAfter="*-8h"    to get a value from 8 hours ago potentially?

       

      Any help is appreciated! Thanks!

        • Re: How to retrieve a value for a point at a certain time using Web API?
          vkaufmann

          Hi Ian,

           

          Depends on what you are trying to achieve. If you use the default of auto, it has the potential of returning an interpolated result which could or could not suite your purpose. If you need an actual recorded value from 8 hours ago, something like this could work. If it has to be exactly 8 hours ago then you should use the 'Exact' retrieval mode.

           

          piwebapi/streams/{WebId}/recordedattime?time=*-8h&retrievalMode=AtOrAfter

           

          --Vince