I'm in the final stages of designing a REST based API for my SaaS billing site, but I'm stuck debating whether I should include a version number (/1/clients/list) or not (/clients/list).
Obviously the latter is far cleaner and simpler, but am I shooting myself in the foot by leaving out the version number?
GET /client
Accepts: application/vnd.clientlist.v1+json
And they would get back the version 1 client list response. If they want v2, etc, they can specify a different content type (clientlist.v2+json, etc). Also note, that putting verbs in your URIs is counterintuitive. The verb for a REST operation is the HTTP method (GET, POST, PUT, DELETE). The URI should simply represent the resource being retrieved. An argument can be made that the client list is the resource, but in reality listing things from a REST API is a first class concept and shouldn't need separate URIs. It's simply a request for a specific resource type without qualifying it by asking for a single instance of that resource. So, GET /client would return all clients (can add query parameters for pagination, etc), GET /client/834 would return a single client resource.
See also: http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hyperte...