Personal tools

API r6

From PhotoVoltaic Logger new generation

Jump to: navigation, search

Routes

batch/:guid [PUT]
channel/:guid/:attribute [GET]
channel/:guid/parent(/:attribute) [GET]
channel/:guid/stats [GET]
channel/:guid [GET]
channel/:id [DELETE]
channel [PUT]
channels [GET]
csv/:guid [PUT]
data/:guid(/:p1(/:p2)) [GET]
data/:guid/:timestamp [DELETE]
data/:guid [POST]
data/:guid [PUT]
data/raw/:guid [PUT]
data/stats [GET]
daylight(/:offset) [GET]
daylight/:latitude/:longitude(/:offset) [GET]
hash [GET|POST]
help [ANY]
helphtml [ANY]
hierarchy [GET]
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]
store/:key [GET]
store/:key [PUT]
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/:id [GET]
tree/:p_guid/:c_guid [PUT]
tree/alias/:id [PUT]
tree [GET]

Version r6

[PUT] /api/r6/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/r6/channel/:guid/:attribute ^

Fetch specific channel attribute

  • API key required: yes
  • Available since: r3

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

Fetch all attributes or a specific attribute from parent channel

  • API key required: yes
  • Available since: r4

[GET] /api/r6/channel/:guid/stats ^

Fetch channel statistics

  • API key required: yes
  • Available since: r5

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

Fetch single channel attribute

  • API key required: yes
  • Available since: r3

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

Delete channel and its readings

  • API key required: yes
  • Available since: r4

[PUT] /api/r6/channel ^

Create channel

  • API key required: yes
  • Available since: r5

[GET] /api/r6/channels ^

Fetch all channels

  • API key required: yes
  • Available since: r3

[PUT] /api/r6/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/r6/data/:guid(/:p1(/:p2)) ^

Read reading values

  • API key required: yes
  • Available since: r2

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

Delete a reading value

  • API key required: yes
  • Available since: r2

[POST] /api/r6/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/r6/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/r6/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/r6/data/stats ^

Fetch readings statistics

  • API key required: yes
  • Available since: r5

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

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

  • API key required: yes
  • Available since: r3

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

Check for daylight, accept additional minutes before/after

  • API key required: yes
  • Available since: r3

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

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

  • API key required: yes
  • Available since: r3

Payload

text
Text to make hashes for

[ANY] /api/r6/help ^

This help, overview of valid calls

  • API key required: yes
  • Available since: r1

[ANY] /api/r6/helphtml ^

This help in HTML for browsers, overview of valid calls

  • API key required: yes
  • Available since: r4

[GET] /api/r6/hierarchy ^

Alias for /api/latest/tree

  • API key required: yes
  • Available since: r5

[GET] /api/r6/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/r6/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/r6/jsonencode ^

Encode posted data to JSON

  • API key required: yes
  • Available since: r1

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

Delete a log entry

  • API key required: yes
  • Available since: r2

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

Read a log entry

  • API key required: yes
  • Available since: r2

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

Update a log entry

  • API key required: yes
  • Available since: r2

Payload

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

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

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

  • API key required: yes
  • Available since: r2

[PUT] /api/r6/log ^

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

  • API key required: yes
  • Available since: r2

Payload

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

[GET] /api/r6/ping ^

For new relic pinger

  • API key required: yes
  • Available since: r4

[GET] /api/r6/status ^

System status

  • API key required: yes
  • Available since: r2

[GET] /api/r6/store/:key ^

Retrieve a value for a key

  • API key required: yes
  • Available since: r6

[PUT] /api/r6/store/:key ^

Save a value for a key

  • API key required: yes
  • Available since: r6

Payload

["<data>"]

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

Get sunrise of day, using configured loaction

  • API key required: yes
  • Available since: r3

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

Get sunrise for location and day

  • API key required: yes
  • Available since: r3

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

Get sunset of day, using configured loaction

  • API key required: yes
  • Available since: r3

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

Get sunset of day

  • API key required: yes
  • Available since: r3

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

Extract tariff for a day

  • API key required: yes
  • Available since: r4

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

Extract tariff for a day

  • API key required: yes
  • Available since: r4

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

Extract a tariff

  • API key required: yes
  • Available since: r4

[GET] /api/r6/tariff ^

Extract all tariffs

  • API key required: yes
  • Available since: r4

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

Deliver actual server time

  • API key required: yes
  • Available since: r4

[GET] /api/r6/translation ^

Extract english texts for translation

  • API key required: yes
  • Available since: r3

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

Delete channel from channel hierarchy

  • API key required: yes
  • Available since: r4

[GET] /api/r6/tree/:id ^

Fetch a channel and its direct child channels

  • API key required: yes
  • Available since: r5

[PUT] /api/r6/tree/:p_guid/:c_guid ^

Add channel to parent

  • API key required: yes
  • Available since: r5

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

Create alias from given hierarchy Id

  • API key required: yes
  • Available since: r4

[GET] /api/r6/tree ^

Fetch whole channels hierarchy

  • API key required: yes
  • Available since: r5