[ckan-dev] Example for API usage (e.g. member_create)

Heinrich Widmann widmann at dkrz.de
Mon Apr 8 11:23:26 UTC 2013


Hello,
sorry for the newbie question but I'm still struggling with the basic 
usage of CKAN APIs.

We managed to add and update data sets within our CKAN instance.
Now I want to add datasets to groups by using member_create.
My implemention in python returned no error, but the data set is not 
added to the wanted group of CKAN.
So I tried to test it with curl from command line and submit something 
like :

 >curl <myckan>/api/3/action/member_create -d '{"object":"test3", 
"id":"enes", "object_type":"package", "capacity": "3"}' -H 
"Authorization: <api_key>"

to add (existing) dataset test3 to the group 'ENES' (created the group 
with upper case letters, but I thing all CKAN objects are named lower 
case ?).
( Irecognized, that "capacity" must be set, but what is the appropriate 
value ?)

The response is ... "success": true ..., but if I check no data set is 
added to group CKAN.

What's going wrong ?
Or more general : How can I test (and learn to use) APIs and get more 
verbose error messages to see what's going on.

Best,
Heinrich

-- 
-----------------------------\\---------------------------------------
Heinrich Widmann              \\ Deutsches Klimarechenzentrum GmbH
Phone: +49 40 41173 282        \\   Abteilung Datenmanagement
FAX:   +49 40 41173 476         \\    Bundesstr. 45a
Email: widmann at dkrz.de           \\   D-20146 Hamburg
http://www.dkrz.de                \\  Germany
-----------------------------------\\---------------------------------





More information about the ckan-dev mailing list