[CKAN-support] [ckan-discuss] API and Tag management

Sean Hammond sean.hammond at okfn.org
Tue Oct 1 09:02:05 UTC 2013


> I have also got Python 3.3.2 installed, though I have come across
> problems trying the example python code at the above documentation
> page : seems to have been changes to python with regards to urllib and
> urllib2 amongst other issues. So I have not been able to get the
> examples to work as yet.

The example code is tested with Python 2.6 and 2.7 (same as CKAN
itself). If you like, I can construct an example in Python 3 for you.
Let me know.

> This page references deleting tags:
> http://docs.ckan.org/en/ckan-2.0.2/ckan.logic.action.delete.html
>  
> Is it possible to execute these action.delete commands with the setup
> I have?

Yes, you should have no problem calling any API action using httpie. Do
note however that *_delete actions will require you to provide a CKAN
API key in the http command. This is done with 'Authorization:' in httpie.
For example:

http '127.0.0.1:5000/api/3/action/tag_delete' id=foo Authorization:150a520d-ea52-4a08-9f14-2baa5975ed73

The API key should be the API key of a sysadmin user for tag_delete. To
find your API key, login to the CKAN web interface and go to your
profile page (e.g. /user/seanh).




More information about the ckan-support mailing list