Last active
December 23, 2015 20:39
-
-
Save pelluch/6690757 to your computer and use it in GitHub Desktop.
Veenda API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Trackpoints resource | |
========================================================= | |
URI: http://veenda01.herokuapp.com/trackpoints POST | |
Content-Type: application/json | |
{ | |
position: | |
{ | |
latitude: 72.23128, | |
longitude: -54.232, | |
accuracy: 7, | |
speed: 8, | |
timestamp: "2013-09-25T07:08:23.123Z" | |
}, | |
sender: "MACADDRESSORSOMETHINGLIKETHAT", | |
version: "VEENDA01b" | |
} | |
Status Code : 201 if Created | |
Response: If success, a json object indicating success and a second field depending on the result. If operation was successful: | |
{status:"ok", timestamp:"2013-09-25T07:08:23.123Z"} | |
Otherwise, instead of timestamp the json object contains an errors array with the list of detected errors. | |
{"status":"error","errors":["Version can't be blank","Timestamp has already been taken"]} |
I agree, it's done. Minor thing: If there's an error it returns something like
{"status":"error","errors":["Version can't be blank","Timestamp has already been taken"]}
Since there may be more than one error, I'm putting them in an array, but if you prefer something simpler no problem.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be better something that confirms that everything is ok.
{timestamp:"2013-09-25T07:08:23.123Z", status:"ok"}
{status:"error",error:"version cant be blank"}