Public API v2.x guide
Last updated
Last updated
The Citizen Space API is designed to allow simple integration with other frameworks. Currently the API supports searching and viewing of published activities.
The current version of the API provides read-only access to publicly visible data. This means that no authentication is required as the access level is the same as a public visitor to the site. To get started, all you need to know is the URL of the Citizen Space site that you want to interact with. In this guide we will be talking to our demo site, which lives at , but any Citizen Space site can be used.
Methods should be called via HTTPS GET requests, using the following format:
Arguments are given as url-encoded key/value pairs, and any unsupported arguments will be ignored.
You can talk to the API using any server-side or client-side language that supports HTTPS requests.
To return a filtered list of activities, call json_search_results
with any combination of parameters as specified in the .
For example:
will return a JSON-encoded list of search results where the title or overview contain the phrase "Arlen Hill" (case-insensitive) and the activity is Open (ie its start date has passed and its end date has not yet been reached).
The fields of the returned JSON structure are detailed in the .
This is the preferred method of integration with the Citizen Space API. Caching of results is permitted.
Here is an example of querying the API in python:
Here's an example using javaScript:
You can use the json_consultation_details
method to get the overview information about a single activity, for example:
Here is the same example as a .
The method arguments and the fields of the returned JSON structure are detailed in the .