Hi,
I'm trying to get access my data directly on the flukso server through the RESTful api.
I use the manual and replace the X-token and sensor-token by my own tokens. I get the following message (tokens modified).
roel@Enif:~$ curl -k -v -X GET -H "Accept: application/json" -H "X-Version: 1.0" -H "X-Token: dd9aa4835a7a4e0965f51c227bb1****" "https://api.flukso.net/sensor/399e12b79d5f9bf90491af155ca8****interval=month&unit=watt"
* About to connect() to api.flukso.net port 443 (#0)
* Trying 178.79.177.6...
* connected
* Connected to api.flukso.net (178.79.177.6) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using RC4-SHA
* Server certificate:
* subject: C=BE; O=Flukso; CN=api.flukso.net; emailAddress=admin@flukso.net
* start date: 2012-05
* expire date: 2014-05
* common name: api.flukso.net (matched)
* issuer: C=BE; O
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
> GET /sensor/399e12b79d5f9bf90491af155ca8****interval=month&unit=watt HTTP/1.1
> User-Agent: curl/7.27.0
> Host: api.flukso.net
> Accept: application/json
> X-Version: 1.0
> X-Token: dd9aa4835a7a4e0965f51c227bb1****
>
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 400 Bad Request
< Server: nginx/1.0.10
< Date: Sat, 15 Dec 2012 21:30:34 GMT
< Connection: keep-alive
< Content-Length: 0
<
* Connection #0 to host api.flukso.net left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
Any idea what's going wrong?
Thanks,
roel
Did you include a '?' right before the interval parameter?
no, and with '?' it works indeed. I thought the '?' in the manual was part of the sensor token.
Is this '?' part of a standard or convention linked to this curl command? Maybe include a link in the manual to a page that explains this? Of if it's just 'flukso syntax' it would be good to specify it directly in the manual?
Thanks, happy that it works now.
Roel
The question mark separates the request's query parameters from the absolute path as per HTTP/1.1 specified in RFC2616 section 3.2.2 [1]. It's how the www works, not curl-specific nor a Flukso invention.
Cheers
/Bart