I have a GPS device for which I need to get:
- the last location
- an history of locations
Regarding the last location, I issue a GET on /devices/id_of_my_gps and it returns the data in json {"latitude":2.3, "longitude":4.5, "timestamp": "2012-04-12T12:32:45Z"}
Regarding the history of location, I'm not sure about the best way to do it.
I'm thinking of issuing a GET on /devices/id_of_my_gps/history and providing "from" and "to" timestamps (the dates between which the history needs to be retrieved) as parameters in the query string. Is that breaking the REST approach ?
UPDATE
Would it be better to send the from/to parameters as data in json: {"from":"2012-04-12T12:32:45Z", "to": "2012-04-15T12:32:45Z"} ?