Personal tools

API r5

From PhotoVoltaic Logger new generation

Revision as of 17:27, 28 September 2014 by KKoPV (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Routes

batch/:guid [PUT]
channel/:guid/:attribute [GET]
channel/:guid/parent(/:attribute) [GET]
channel/:guid [GET]
channel/:id [DELETE]
channels [GET]
csv/:guid [PUT]
data/:guid(/:p1(/:p2)) [GET]
data/:guid/:timestamp [DELETE]
data/:guid [POST]
data/:guid [PUT]
data/raw/:guid [PUT]
daylight(/:offset) [GET]
daylight/:latitude/:longitude(/:offset) [GET]
hash [GET|POST]
help [ANY]
helphtml [ANY]
json/:path+ [GET]
json/:path+ [POST]
jsonencode [POST]
log/:id [DELETE]
log/:id [GET]
log/:id [POST]
log/all(/:page(/:count)) [GET]
log [PUT]
ping [GET]
status [GET]
sunrise(/:date) [GET]
sunrise/:latitude/:longitude(/:date) [GET]
sunset(/:date) [GET]
sunset/:latitude/:longitude(/:date) [GET]
tariff/:id/:date [GET]
tariff/:id/time/:date(/:to) [GET]
tariff/:id [GET]
tariff [GET]
time(/:format) [GET]
translation [GET]
tree/:id [DELETE]
tree/alias/:id [PUT]
view/:slug [DELETE]
view/:slug [GET]
view/:slug [POST]
view [PUT]
views(/:language) [GET]

[PUT] /api/r5/batch/:guid ^

Save multiple reading values

  • API key required: yes
  • Available since: r2

Header

X-PVLng-CSV-RecordSeparator
Set record separator (if not semicolon) since r5, "TAB" as string will be also accepted
X-PVLng-CSV-Separator
Set data separator (if not comma) since r5, "TAB" as string will be also accepted

Payload

<timestamp>,<value>;...
timestamp and value data sets
<date time>,<value>;...
date time and value data sets
<date>,<time>,<value>;...
date, time and value data sets

[GET] /api/r5/channel/:guid/:attribute ^

Fetch all channel attributes or specific channel attribute

  • API key required: yes
  • Available since: r3

[GET] /api/r5/channel/:guid/parent(/:attribute) ^

Fetch all attributes or a specific attribute from parent channel

  • API key required: yes
  • Available since: r4

[GET] /api/r5/channel/:guid ^

Fetch single channel attribute

  • API key required: yes
  • Available since: r3

[DELETE] /api/r5/channel/:id ^

Delete channel and its readings

  • API key required: yes
  • Available since: r4

[GET] /api/r5/channels ^

Fetch all channels

  • API key required: yes
  • Available since: r3

[PUT] /api/r5/csv/:guid ^

Save multiple reading values from CSV

  • API key required: yes
  • Available since: r2

Header

X-PVLng-CSV-Separator
Set data separator (if not semicolon) since r5, "TAB" as string will be also accepted

Payload

<timestamp>;<value>
timestamp and value data row(s)
<date time>;<value>
date time and value data row(s)
<date>;<time>;<value>
date, time and value data row(s)

[GET] /api/r5/data/:guid(/:p1(/:p2)) ^

Read reading values

  • API key required: yes
  • Available since: r2

[DELETE] /api/r5/data/:guid/:timestamp ^

Delete a reading value

  • API key required: yes
  • Available since: r2

[POST] /api/r5/data/:guid ^

Update a reading value, timestamp is required here

  • API key required: yes
  • Available since: r4

Payload

{"data":"<value>","timestamp":"<timestamp>"}
JSON encoded value

[PUT] /api/r5/data/:guid ^

Save a reading value

  • API key required: yes
  • Available since: r2

Payload

{"data":"<value>"}
JSON encoded value, use server time
{"data":"<value>","timestamp":"<timestamp>"}
JSON encoded value, use provided timestamp
{"data":"<value>","timestamp":"<date time>"}
JSON encoded value, use provided date and time

[PUT] /api/r5/data/raw/:guid ^

Save raw data, channel decide what to do with them

  • API key required: yes
  • Available since: r4

Payload

raw data in any format
Channel have to handle it

[GET] /api/r5/daylight(/:offset) ^

Check for daylight for configured location, accept additional minutes before/after

  • API key required: yes
  • Available since: r3

[GET] /api/r5/daylight/:latitude/:longitude(/:offset) ^

Check for daylight, accept additional minutes before/after

  • API key required: yes
  • Available since: r3

[GET|POST] /api/r5/hash ^

Create MD5 and SHA1 hashes and a slug for the given text

  • API key required: yes
  • Available since: r3

[ANY] /api/r5/help ^

This help, overview of valid calls

  • API key required: yes
  • Available since: r1

[ANY] /api/r5/helphtml ^

This help in HTML for browsers, overview of valid calls

  • API key required: yes
  • Available since: r4

[GET] /api/r5/json/:path+ ^

Extract a section/value from given JSON data from query string

  • API key required: yes
  • Available since: r1

Payload

...json/path/to/node/?json=<JSON data>

[POST] /api/r5/json/:path+ ^

Extract a section/value from given JSON data sended in request body e.g. from a file

  • API key required: yes
  • Available since: r1

[POST] /api/r5/jsonencode ^

Encode posted data to JSON

  • API key required: yes
  • Available since: r1

[DELETE] /api/r5/log/:id ^

Delete a log entry

  • API key required: yes
  • Available since: r2

[GET] /api/r5/log/:id ^

Read a log entry

  • API key required: yes
  • Available since: r2

[POST] /api/r5/log/:id ^

Update a log entry

  • API key required: yes
  • Available since: r2

Payload

{"scope":"...", "message":"..."}

[GET] /api/r5/log/all(/:page(/:count)) ^

Read all log entries, paginated for :page, :count entries

  • API key required: yes
  • Available since: r2

[PUT] /api/r5/log ^

Store new log entry, scope defaults to 'API rr5'

  • API key required: yes
  • Available since: r2

Payload

{"scope":"...", "message":"..."}

[GET] /api/r5/ping ^

For new relic pinger

  • API key required: yes
  • Available since: r4

[GET] /api/r5/status ^

System status

  • API key required: yes
  • Available since: r2

[GET] /api/r5/sunrise(/:date) ^

Get sunrise of day, using configured loaction

  • API key required: yes
  • Available since: r3

[GET] /api/r5/sunrise/:latitude/:longitude(/:date) ^

Get sunrise for location and day

  • API key required: yes
  • Available since: r3

[GET] /api/r5/sunset(/:date) ^

Get sunset of day, using configured loaction

  • API key required: yes
  • Available since: r3

[GET] /api/r5/sunset/:latitude/:longitude(/:date) ^

Get sunset of day

  • API key required: yes
  • Available since: r3

[GET] /api/r5/tariff/:id/:date ^

Extract tariff for a day

  • API key required: yes
  • Available since: r4

[GET] /api/r5/tariff/:id/time/:date(/:to) ^

Extract tariff for a day

  • API key required: yes
  • Available since: r4

[GET] /api/r5/tariff/:id ^

Extract a tariff

  • API key required: yes
  • Available since: r4

[GET] /api/r5/tariff ^

Extract all tariffs

  • API key required: yes
  • Available since: r4

[GET] /api/r5/time(/:format) ^

Deliver actual server time

  • API key required: yes
  • Available since: r4

[GET] /api/r5/translation ^

Extract english texts for translation

  • API key required: yes
  • Available since: r3

[DELETE] /api/r5/tree/:id ^

Delete channel from channel hierarchy

  • API key required: yes
  • Available since: r4

[PUT] /api/r5/tree/alias/:id ^

Create alias from given hierarchy Id

  • API key required: yes
  • Available since: r4

[DELETE] /api/r5/view/:slug ^

Detele chart view data by slug

  • API key required: yes
  • Available since: r3

[GET] /api/r5/view/:slug ^

Fetch chart view data via slug

  • API key required: yes
  • Available since: r3

[POST] /api/r5/view/:slug ^

Update chart view data via slug

  • API key required: yes
  • Available since: r3

[PUT] /api/r5/view ^

Create chart view data, return slug

  • API key required: yes
  • Available since: r3

[GET] /api/r5/views(/:language) ^

Fetch all charts

  • API key required: yes
  • Available since: r3