1 Reply Latest reply on May 8, 2014 8:32 PM by Bhess

    Posting Data to WebAPI

    chriswhsu

      From what I can tell from the available documentation, the only option to post timeseries data to the Pi Server is via: 

       

         POST streams/{webId}/value

       

      ...with the data payload consisting of the following json format:

       

         { "Timestamp": "2014-03-19T15:16:41.9985701-04:00", "Value": 25.0, "UnitsAbbreviation": "m", "Good": true, "Questionable": true, "Substituted": false }

       

      So a few questions:

      1. Is there a way to post more than one data point (same stream) at varying timestamps in a single Post?
      2. Is there a way to post more than one data point across multiple streams (for same device) in a single Post?
      3. Is the above timestamp format the only that the api will accept?  I would like to post an epoch timestamp so I don't have to worry about timezones.
      Thanks,
      Chris
        • Re: Posting Data to WebAPI
          Bhess

          As to #1 and #2, not at present, though it's definitely in the plans for a future release.  For now, it's multiple POSTs to record multiple values.

           

          As to #3, the time syntax can be anything that is parsable by new AFTime(string time).  I recommend using an ISO 8601 time:

           

          www.w3.org/.../NOTE-datetime

           

          All output from the Web API is in Zulu time, in the form 2014-03-19T15:16:41.9985701Z.