-
Notifications
You must be signed in to change notification settings - Fork 1
doc add
duetosymmetry edited this page Jan 26, 2012
·
5 revisions
Make a GET or POST request to: http://leostein.scripts.mit.edu/StudyBeacon/add.py (Sidenote: will probably want to use POST since Details text is long)
With parameters:
- Course -- (Required) string name of course.
- LatE6 -- (Required) E6 integer between -80000000 and +80000000
- LonE6 -- (Required) E6 integer between -180000000 and +180000000
- DeviceId -- (Required) positive HEX integer which is a unique device identifier. This is hex because ANDROID_ID is already a string hex integer.
- Duration -- (optional) positive integer number of minutes. Default: 460. Maximum: 3660.
- Details -- (optional) string
- WorkingOn -- (optional) string
- Telephone -- (optional) string
- Email -- (optional) string
If there is currently an entry in the devices table with DeviceId, then this will fail. In fact, there are many ways this can fail. It's supposed to return an HTTP status 400 for problematic input and 502 for SQL problems. I haven't really tested this to see if it's bulletproof. If you want to, take a shot at it and keep track of the queries that failed.
On success, the script returns the one created row as a JSONObject.