ckanext-lacounts
CKAN extension for the LA Counts project
Requirements
This extension is being developed against CKAN 2.8.x
Installation
To install ckanext-lacounts for development, activate your CKAN virtualenv and
do::
git clone https://github.com/okfn/ckanext-lacounts.git
cd ckanext-lacounts
python setup.py develop
pip install -r requirements.txt
API (Get Involved page actions)
Actions for the Get Involved page are available in the CKAN Action API.
Event actions:
Available parameters:
id: a uuid (required for some actions, see below)
name: a string (required)
date: a date string e.g. “2019-01-21” (required)
free: a boolean-like, e.g. “yes” or true (required)
url: a string url
location: a string
topic_tags: a list of strings, e.g. [“Housing”, “Employment”]
A full example for event_create:
$ curl -X POST http://127.0.0.1:5000/api/3/action/event_create -H "Authorization:{YOUR-API-KEY}" -d '{"name": "My New Event", "free": "yes", "date": "2019-01-21", "url": "http://example.com/event-details", "location": "Downton, Los Angeles", "topic_tags": ["Housing", "Employment"]}'
All Event actions:
“`sh
create a new event (sysadmins only)
curl -X POST http://127.0.0.1:5000/api/3/action/event_create -H “Authorization:{YOUR-API-KEY}” -d ‘{“name”: “My New Event”, “free”: “yes”, “date”: “2019-01-21”}’
update an existing event (sysadmins only)
curl -X POST http://127.0.0.1:5000/api/3/action/event_update -H “Authorization:{YOUR-API-KEY}” -d ‘{“id”: “my-event-id”, “name”: “My Updated Event”, “free”: “no”, “date”: “2020-01-21”}’
delete an event (sysadmins only)
curl -X POST http://127.0.0.1:5000/api/3/action/event_delete -H “Authorization:{YOUR-API-KEY}” -d ‘{“id”: “my-event-id”}’
show an event
curl http://127.0.0.1:5000/api/3/action/event_show -d ‘{“id”: “my-event-id”}’
list events limit and offset are optional.
curl http://127.0.0.1:5000/api/3/action/event_list -H “Autho