Comments (3)
Hijacking this to post a valid curl call which might be handy to post as an example:
curl -i -H "Content-type: application/json" -X POST -d '{"sensorid":"sensor_id","timestamp":"2015-11-10T22:32:00Z","value":11,"key":"d6ba65e8-4aa7-4bd8-90bc-df939aaaae99"}' http://friskby.herokuapp.com/sensor/api/reading/
from friskby.
Ehh - yes I agree this is slightly confusing; but both work. The actual comparison is done here: https://github.com/FriskByBergen/friskby/blob/master/api_key/models.py#L14 - and the UUID( )
constructor will strip of the dashes internally.
from friskby.
Are you sure? I re-tested and get "invalid key" when omitting dashes.
curl -i -H "Content-type: application/json" -X POST -d '{"sensorid":"ARUtest","timestamp":"2015-11-10T22:32:00Z","value":11,"key":"d6b065e842a74bd890bcdf939d91de99"}' http://friskby.herokuapp.com/sensor/api/reading/
HTTP/1.1 403 FORBIDDEN
"Invalid key:'d6b065e842a74bd890bcdf939d91de99' when posting to:'ARUtest'"
curl -i -H "Content-type: application/json" -X POST -d '{"sensorid":"ARUtest","timestamp":"2015-11-10T22:32:00Z","value":11,"key":"d6b065e8-42a7-4bd8-90bc-df939d91de99"}' http://friskby.herokuapp.com/sensor/api/reading/
HTTP/1.1 201 CREATED
I see now that the page I linked to is actually intended for editing so its probably a bad idea to get the key from there anyway. But maybe update the example on the main page with a dummy key with dashes, or allow keys with and without dashes?
from friskby.
Related Issues (20)
- WIP Generating primary key for raw_data HOT 13
- PM25 and PM10 columns in Quick are showing the same values HOT 2
- Quick Highchart Safari support HOT 14
- Wrong "last value" in status table HOT 1
- Midnight data received from BG sensors are interpreted +24h wrong HOT 9
- Consistent sorting of devices? HOT 2
- OpenLayers - map stretched initially HOT 3
- Remove space character from URLs HOT 6
- Merge friskby.no and http://friskby.herokuapp.com/ HOT 15
- Server error on front end trying to show PM2.5 HOT 1
- Make index on rawdata.timestamp HOT 3
- Consider removing the TimeStamp model HOT 2
- Setup of new devices
- Create custom raspbian-pi image with friskby pre-installed HOT 1
- API v1.0 HOT 5
- API for new device, new location for given device
- Accept posting without timestamp HOT 3
- API for location creation should respond properly
- API for location creation needs to be CSRF exempt
- Migrate from heroku
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from friskby.