Personal tools

API r3

From PhotoVoltaic Logger new generation

Jump to: navigation, search
   "ANY /api/r3/help": {
       "since": "v1",
       "description": "This help, overview of valid calls"
   },
   "GET /api/r3/:guid": {
       "since": "v2",
       "description": "Fetch attributes",
       "conditions": {
           "guid": "(\\w{4}-){7}\\w{4}"
       }
   },
   "GET /api/r3/:guid/:attribute": {
       "since": "v2",
       "description": "Fetch single channel attribute",
       "conditions": {
           "guid": "(\\w{4}-){7}\\w{4}",
           "attribute": "\\w+"
       }
   },
   "GET /api/r3/attributes/:guid(/:attribute)": {
       "since": "v2",
       "description": "Fetch all channel attributes or specific channel attribute",
       "conditions": {
           "guid": "(\\w{4}-){7}\\w{4}",
           "attribute": "\\w+"
       }
   },
   "GET /api/r3/channels": {
       "since": "v3",
       "description": "Fetch attributes"
   },
   "GET /api/r3/channel/:guid": {
       "since": "v3",
       "description": "Fetch single channel attribute",
       "conditions": {
           "guid": "(\\w{4}-){7}\\w{4}"
       }
   },
   "GET /api/r3/channel/:guid/:attribute": {
       "since": "v3",
       "description": "Fetch all channel attributes or specific channel attribute",
       "conditions": {
           "guid": "(\\w{4}-){7}\\w{4}",
           "attribute": "\\w+"
       }
   },
   "PUT /api/r3/data/:guid": {
       "since": "v2",
       "description": "Save a reading value",
       "payload": "{\"\":\"<value>\"}",
       "conditions": {
           "guid": "(\\w{4}-){7}\\w{4}"
       }
   },
   "GET /api/r3/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",
                   "sunrise - needs location in config/config.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",
                   "sunset - needs location in config/config.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"
               ]
           }
       },
       "conditions": {
           "guid": "(\\w{4}-){7}\\w{4}"
       }
   },
   "DELETE /api/r3/data/:guid/:timestamp": {
       "since": "v2",
       "description": "Delete a reading value",
       "conditions": {
           "guid": "(\\w{4}-){7}\\w{4}"
       }
   },
   "PUT /api/r3/batch/:guid": {
       "since": "v2",
       "description": "Save multiple reading values",
       "payload": {
           "<timestamp>,<value>;...": "Semicolon separated timestamp and value data sets",
           "<date time>,<value>;...": "Semicolon separated date time and value data sets",
           "<date>,