[ckan-dev] Deleting tags with the api

Aaron McGlinchy McGlinchyA at landcareresearch.co.nz
Wed Nov 4 01:07:01 UTC 2015


I solved my own problem, the tags are case sensitive, hence

 http http://test.ckan.zen.landcareresearch.co.nz/api/3/action/tag_delete id=" Vegetation Survey" Authorization: XXXXXXXXXXXXXXXXXXXXXX

worked, whilst

http http://test.ckan.zen.landcareresearch.co.nz/api/3/action/tag_delete id=" vegetation survey" Authorization: XXXXXXXXXXXXXXXXXXXXXX

did not.

Also, I was copying and pasting variants of the command in a word doc I had open, and pasting into my cmd window - the font affected wether the command worked as the quote mark used affected the result e.g. "tag one" would not work, but "tag one" would work.

Subtle but important differences!

Aaron

-----Original Message-----
From: Aaron McGlinchy
Sent: Wednesday, 4 November 2015 12:37 p.m.
To: 'ckan-dev at lists.okfn.org'
Subject: Deleting tags with the api

Hi,
    I am using the ckanapi to test out tidying up tags.  I'm using the python client, and httpie

I can get these commands to work fine

List all tags :
http http://test.ckan.zen.landcareresearch.co.nz/api/3/action/tag_list

Delete tag taxonomist:
http http://test.ckan.zen.landcareresearch.co.nz/api/3/action/tag_delete id=taxonomist Authorization:XXXXXXXXXXXXXXXXXXXXXX

but when the tag contains spaces I am struggling e.g. " vegetation survey" (inc leading space)  or "vegetation survey"
http http://test.ckan.zen.landcareresearch.co.nz/api/3/action/tag_delete id=vegetation survey Authorization: XXXXXXXXXXXXXXXXXXXXXX

I've tried various ways of specifying the words with spaces,  such as in quotes, inside braces, with underscore for space... but keep getting errors.

How do I deal with a tag value that includes spaces?

Thanks
Aaron

________________________________

Please consider the environment before printing this email
Warning: This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not read, use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails.
The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz



More information about the ckan-dev mailing list