[ckan-dev] including organization in a package_create

Henrik Korsgaard henrikkorsgaard at gmail.com
Fri Jun 7 07:12:21 UTC 2013


Hi Paul,

I do not think the owning organisation is documented in the API, but the
parameter is "owner_org". I have some javascript code using the parameter
when I do a simple package create:

function package_create(base_ckan_url, apikey, name, author, org,
 callback){
    var json_data = {"name":name, "author":author, "owner_org":org};
    json_data = JSON.stringify(json_data);
    action_post(base_ckan_url+"/api/3/action/package_create", json_data,
apikey, callback);
}

I do an ajax POST with api key in headers (the action_post() function).

I think the parameter take both ids and names (not display name, but url
name) of organisation. Hope that helps.



On 7 June 2013 08:36, Paul Hermans <paul at proxml.be> wrote:

> Hi,
>
> context: API 3 in CKAN 2.0
>
> I'm trying to include the organization, which has been already created in
> CKAN,  in the JSON payload of a package_create.
> But whatever I try I always get as result organization: null.
>
> If I look at the help which is part of the response after the POST, I
> notice that the param:organization is not mentioned herein.
>
> What am I missing?
>
>
> Paul
>
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
>


-- 
Med venlig hilsen - Best regards,

*Henrik Korsgaard*
Phone: +45 22377114
Office: CAVI 114b, Aarhus University

NB. I am slowly migrating my university related correspondence to my
official AU mail: korsgaard at cavi.au.dk - feel free to contact me at that
address if relevant.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130607/e7ee598e/attachment-0001.html>


More information about the ckan-dev mailing list