codeforamerica / councilmatic

A subscription service for city council legislative information, started in Philadelphia.
http://councilmatic.org
58 stars 22 forks source link

API references should be by URL and internal ID #22

Closed mjumbewu closed 11 years ago

mjumbewu commented 12 years ago

API references should be by URL and internal ID. For example, on the legislation endpoint (http://www.councilmatic.org/api/v2/files/), the sponsors are referred only by URL. This is necessary for a well-connected REST interface, but is not sufficient for a useful interface considering conventions of REST-based JS frameworks in particular. It would be prudent to use a small object with {"id": "123", "uri": "http://..."} in favor of just a URI (though it is technically redundant).

Also, all resources should include their own URI in their definition. For example, a councilmember (http://www.councilmatic.org/api/v2/councilmembers/29) has no self-uri reference.

mjumbewu commented 11 years ago

I don't feel this way anymore. I see the aesthetic sense in using database ids for references, but I'm ok with using the URL as an identifier for the purposes of the REST interface.