New user, trouble accessing locally

Hi,

Received and set up my new Fluksometer few hours ago :-). So far, so good: now it is registered and I can see the data on my Dashboard on flukso.net. Also obtained a sensor id and token. Using curl commands like this works great:

  1. curl -k -X GET -H "Accept: application/json" -H "X-Version: 1.0" -H "X-Token: xxxxxxxxxx" "https://api.flukso.net/sensor/yyyyyyy?interval=hour&unit=watt"

However the problem is that I can't obtain valid response from the local JSON interface. Is is enabled in the web interface. I am trying with:

  1. curl -k -X GET -H "Accept: application/json" -H "X-Version: 1.0" "http://192.168.1.160:8080/sensor/yyyy?interval=minute&unit=watt"

But the answer always is:

  1. Malformed query string interval, unit and version query parameters are required.

What is wrong? Tried with and without token, with the version in header and as parameter with no success.

Thank you in advance!

svet's picture

Ok, "for the record" I am answering myself: it seems that headers should not be used. The version shoud should be specified as parameter and Accept header should *not* be present. This works ok:

  1. curl -k -X GET "http://192.168.1.160:8080/sensor/yyyy?interval=minute&unit=watt&version=1.0"

icarus75's picture

Correct. No header parsing is done on the local API, contrary to api.flukso.net. All parameters should be included as query params, i.e. following the '?'.