REST API for Open Data Catalog #1

merged 14 commits into from Dec 2, 2011


None yet

2 participants


A Django app that provides REST based web services for the open data catalog
All URLs support only the GET method unless otherwise noted. In addition, all GET services generate JSON responses and all PUT/POST services consume JSON.

To enable the API app add api to INSTALLED_APPS


REST service authentication is done using HTTP Basic Authentication (and really should be done over https, but opendataphilly sends login credentials in the clear right now)


api/resources/ - Get a list of resources (data sets)
api/resources/{id}/ - Get all information about a specific resource
api/resources/search?qs={search query} - Search for resources that contain the given search query


api/tags/ - Get a list of tags
api/tags/{tag name}/ - Get a list of Resources associated with a given tag name


api/ideas/ - Get a list of ideas
api/ideas/{id} - Get all information (including pictures, etc) about an Idea with the given id


api/suggestions/ - GET - List all suggestions
api/suggestions/ - POST (Authentication Required) - Create a new suggestion
api/suggestions/search?qs={search query} - Search suggestions for the given query
api/suggestions/{id}/ - Get all information about the given suggestion
api/suggestions/{id}/vote - PUT (Authentication Required) - Vote for the given suggestion. Users can call this method as often as they would like but the maximum number of votes recorded for a given user is 1. Returns the updated suggestion
api/suggestions/{id}/vote - DELETE (Authentication Required) - Remove vote for the given suggestion. This method may be called more than once and since a user can only have 1 vote the result will always be the same. Returns the updated suggestion.

Submit Data Sets

api/submit/ - POST (Authentication Required) - Submit a new dataset to be approved


I'm not sure why but running python test fails due to paginator and a few other django.contrib modules. So to run the tests for just the api app:

python test api

As a side note, this is my first time using django and python so some of the code can probably be a lot more Pythonic/Djangoian


Thanks for the pull request! I'll take a look at the changes some time this week.

@alsaihn alsaihn was assigned Jul 5, 2011
@ahinz ahinz merged commit d10edb2 into azavea:master Dec 2, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment