Personal tools

Difference between revisions of "API r6"

From PhotoVoltaic Logger new generation

Jump to: navigation, search
(Created page with "Category:API<html> <div style="float:right;margin-left:1em;padding:1em;border:dashed gray 1px;font-size:small"> <strong>Routes</strong> <br...")
(No difference)

Revision as of 21:55, 28 February 2015

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/latest/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/latest/channel/:guid/:attribute ^

Fetch specific channel attribute

  • API key required: yes
  • Available since: r3

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

Fetch all attributes or a specific attribute from parent channel

  • API key required: yes
  • Available since: r4

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

Fetch channel statistics

  • API key required: yes
  • Available since: r5

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

Fetch single channel attribute

  • API key required: yes
  • Available since: r3

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

Delete channel and its readings

  • API key required: yes
  • Available since: r4

[PUT] /api/latest/channel ^

Create channel

  • API key required: yes
  • Available since: r5

[GET] /api/latest/channels ^

Fetch all channels

  • API key required: yes
  • Available since: r3

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

Read reading values

  • API key required: yes
  • Available since: r2

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

Delete a reading value

  • API key required: yes
  • Available since: r2

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

Fetch readings statistics

  • API key required: yes
  • Available since: r5

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

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

  • API key required: yes
  • Available since: r3

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

Check for daylight, accept additional minutes before/after

  • API key required: yes
  • Available since: r3

[GET|POST] /api/latest/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/latest/help ^

This help, overview of valid calls

  • API key required: yes
  • Available since: r1

[ANY] /api/latest/helphtml ^

This help in HTML for browsers, overview of valid calls

  • API key required: yes
  • Available since: r4

[GET] /api/latest/hierarchy ^

Alias for /api/latest/tree

  • API key required: yes
  • Available since: r5

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

Encode posted data to JSON

  • API key required: yes
  • Available since: r1

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

Delete a log entry

  • API key required: yes
  • Available since: r2

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

Read a log entry

  • API key required: yes
  • Available since: r2

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

Update a log entry

  • API key required: yes
  • Available since: r2

Payload

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

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

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

  • API key required: yes
  • Available since: r2

[PUT] /api/latest/log ^

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

  • API key required: yes
  • Available since: r2

Payload

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

[GET] /api/latest/ping ^

For new relic pinger

  • API key required: yes
  • Available since: r4

[GET] /api/latest/status ^

System status

  • API key required: yes
  • Available since: r2

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

Retrieve a value for a key

  • API key required: yes
  • Available since: r5

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

Save a value for a key

  • API key required: yes
  • Available since: r5

Payload

["<data>"]

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

Get sunrise of day, using configured loaction

  • API key required: yes
  • Available since: r3

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

Get sunrise for location and day

  • API key required: yes
  • Available since: r3

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

Get sunset of day, using configured loaction

  • API key required: yes
  • Available since: r3

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

Get sunset of day

  • API key required: yes
  • Available since: r3

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

Extract tariff for a day

  • API key required: yes
  • Available since: r4

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

Extract tariff for a day

  • API key required: yes
  • Available since: r4

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

Extract a tariff

  • API key required: yes
  • Available since: r4

[GET] /api/latest/tariff ^

Extract all tariffs

  • API key required: yes
  • Available since: r4

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

Deliver actual server time

  • API key required: yes
  • Available since: r4

[GET] /api/latest/translation ^

Extract english texts for translation

  • API key required: yes
  • Available since: r3

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

Delete channel from channel hierarchy

  • API key required: yes
  • Available since: r4

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

Fetch a channel and its direct child channels

  • API key required: yes
  • Available since: r5

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

Add channel to parent

  • API key required: yes
  • Available since: r5

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

Create alias from given hierarchy Id

  • API key required: yes
  • Available since: r4

[GET] /api/latest/tree ^

Fetch whole channels hierarchy

  • API key required: yes
  • Available since: r5