Skip to content

Instantly share code, notes, and snippets.

@pelluch
Last active December 23, 2015 20:39
Show Gist options
  • Save pelluch/6690757 to your computer and use it in GitHub Desktop.
Save pelluch/6690757 to your computer and use it in GitHub Desktop.
Veenda API
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"]}
@lomefin
Copy link

lomefin commented Sep 24, 2013

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"}

@pelluch
Copy link
Author

pelluch commented Sep 25, 2013

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