Personal tools

Difference between revisions of "API r2"

From PhotoVoltaic Logger new generation

Jump to: navigation, search
(Created page with " "ANY /api/r2/help": { "since": "v1", "description": "This help, overview of valid calls" }, "GET /api/r2/:guid": { "since": "v2", "...")
(No difference)

Revision as of 16:23, 28 September 2014

   "ANY /api/r2/help": {
       "since": "v1",
       "description": "This help, overview of valid calls"
   },
   "GET /api/r2/:guid": {
       "since": "v2",
       "description": "Fetch attributes"
   },
   "GET /api/r2/:guid/:attribute": {
       "since": "v2",
       "description": "Fetch single channel attribute"
   },
   "GET /api/r2/attributes/:guid(/:attribute)": {
       "since": "v2",
       "description": "Fetch all channel attributes or specific channel attribute"
   },
   "PUT /api/r2/data/:guid": {
       "since": "v2",
       "description": "Save a reading value",
       "payload": "{\"data\":\"<value>\"}"
   },
   "DELETE /api/r2/data/:guid/:timestamp": {
       "since": "v2",
       "description": "Delete a reading value"
   },
   "GET /api/r2/data/:guid(/:p1(/:p2))": {
       "since": "v2",
       "description": "Read reading values",
       "parameters": {
           "start": {
               "description": "Start timestamp for readout, default today 00:00",
               "value": [
                   "YYYY-mm-dd HH:ii:ss",
                   "seconds since 1970",
                   "relative from now, see http://php.net/manual/en/datetime.formats.relative.php"
               ]
           },
           "end": {
               "description": "End timestamp for readout, default today midnight",
               "value": [
                   "YYYY-mm-dd HH:ii:ss",
                   "seconds since 1970",
                   "relative from now, see http://php.net/manual/en/datetime.formats.relative.php"
               ]
           },
           "period": {
               "description": "Aggregation period, default none",
               "value": [
                   "[0-9.]+minutes",
                   "[0-9.]+hours",
                   "[0-9.]+days",
                   "[0-9.]+weeks",
                   "[0-9.]+month",
                   "[0-9.]+quarters",
                   "[0-9.]+years",
                   "last",
                   "readlast",
                   "all"
               ]
           },
           "attributes": {
               "description": "Return channel attributes as 1st line",
               "value": [
                   1,
                   "true"
               ]
           },
           "full": {
               "description": "Return all data, not only timestamp and value",
               "value": [
                   1,
                   "true"
               ]
           },
           "short": {
               "description": "Return data as array, not object",
               "value": [
                   1,
                   "true"
               ]
           }
       }
   },
   "PUT /api/r2/csv/:guid": {
       "since": "v2",
       "description": "Save multiple reading values",
       "payload": {
           "<timestamp>;<value>": "Semicolon separated timestamp and value data rows",
           "<date time>;<value>": "Semicolon separated date time and value data rows",
           "<date>;