[ckan-discuss] Updating A Dataset's Organization

Todd Bleess TBleess at drcog.org
Tue May 6 14:27:24 UTC 2014


I've been attempting to use python and the API, specifically package_owner_org_update, to change the organization to which dataset's belong in CKAN but I keep getting HTTP Error 500: Internal Server Error. I'm using a sysadmin api key so that shouldn't be the problem (if I use a non-sysadmin key I get  HTTP Error 403: Forbidden instead).

import urllib2
import urllib
import json

data_string = urllib.quote(json.dumps({'id': 'bike', 'organization_id': 'denver'}))

request = urllib2.Request(
    'http://{url}/api/3/action/package_owner_org_update')

request.add_header('Authorization', 'xxx')

response = urllib2.urlopen(request, data_string)

I get the python HTTP error at this point. I know I have a dataset called bike and an organization called denver. I've tried it using the id string instead of name as well with similar results. I think I'm missing something fairly simple here.

Todd Bleess | GIS Specialist | Admin & Finance
Direct 303-480-6797 | Fax 303-480-6790 | tbleess at drcog.org<mailto:tbleess at drcog.org>

[cid:image001.gif at 01CF6902.2CFA3580]<http://www.drcog.org/>

[cid:image002.jpg at 01CF6902.2CFA3580]<https://mywaytogo.org/#/>
Check out the new MyWaytoGo<https://mywaytogo.org/#/> website for a brand-new look at commuting.
[cid:image003.png at 01CF6902.2CFA3580]<http://www.facebook.com/Denver.Regional.Council.of.Governments>   [cid:image004.png at 01CF6902.2CFA3580] <https://twitter.com/DRCOGorg>    [cid:image005.png at 01CF6902.2CFA3580] <http://www.linkedin.com/company/denver-regional-council-of-governments?trk=cp_followed_name_denver-regional-council-of-governments>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/pipermail/ckan-discuss/attachments/20140506/823fd12a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 8239 bytes
Desc: image001.gif
URL: <https://lists.okfn.org/pipermail/ckan-discuss/attachments/20140506/823fd12a/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 4623 bytes
Desc: image002.jpg
URL: <https://lists.okfn.org/pipermail/ckan-discuss/attachments/20140506/823fd12a/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 2696 bytes
Desc: image003.png
URL: <https://lists.okfn.org/pipermail/ckan-discuss/attachments/20140506/823fd12a/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 1830 bytes
Desc: image004.png
URL: <https://lists.okfn.org/pipermail/ckan-discuss/attachments/20140506/823fd12a/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 2770 bytes
Desc: image005.png
URL: <https://lists.okfn.org/pipermail/ckan-discuss/attachments/20140506/823fd12a/attachment-0005.png>


More information about the ckan-discuss mailing list