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

Vitor Baptista vitor at vitorbaptista.com
Tue Apr 9 23:54:42 UTC 2013


Hi Heinrich,

The problem with your request is that "object" should be the Package's id
(i.e. f2289f02-4ae7-4600-8adc-3ccd450b9498), not its name. Also, I'm not
sure if capacity = 3 means something. Looked through the code but couldn't
find anything. The capacity values I found were public and private, but I
might be wrong.

Cheers,
Vítor Baptista.

2013/4/8 Heinrich Widmann <widmann at dkrz.de>

> 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
> ------------------------------**-----\\-----------------------**----------
>
>
> ______________________________**_________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/**listinfo/ckan-dev<http://lists.okfn.org/mailman/listinfo/ckan-dev>
> Unsubscribe: http://lists.okfn.org/mailman/**options/ckan-dev<http://lists.okfn.org/mailman/options/ckan-dev>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130409/b51eead4/attachment-0001.html>


More information about the ckan-dev mailing list