18F/foia-hub — pull request #155 by khandelwal (2014-10-20 21:52:36+00:00)
Title: A cleaner API

I'm submitting this pull request now, before it becomes a giant hairy monster alone in a closet.

This makes some major changes.

1. This changes all of the API endpoints:

/agencyoffice/autocomplete is now /agency/
/agencyoffice/contacts/department-of-commerce is now /agency/department-of-commerce
/office/department-of-commerce--office1 is now a thing too.

I think this API better represents how we should think about these things. Autocomplete wasn't a feature of the API - so it makes sense that endpoint lists agencies etc.

2. This removes /requests/autocomplete (the much older autocomplete).

In a subsequent pull request, I'll completely remove the AgencyOffice resource. That was a hacky way to do things before we had the database structure we have now. I'll also probably remove the '--' slug syntax for offices in the future, as that's cumbersome.