[ckan-discuss] Delete packages with api - 403 error

John Mrziglod mrzo at gmx.de
Thu May 23 16:04:15 BST 2013


Hi everyone,
I have some problems with my CKAN2.0 installation.
At first I want to create a package via the rest api. Here is a short section from my python code:
 
action_url = host + "/api/rest/dataset"
api_key = 'xxx'
request = urllib2.Request(action_url,'{"name":"testobject4"}')
request.add_header('Authorization', api_key)
response = urllib2.urlopen(request)
 
It worked fine but now I want to delete it and I get the error code 403. My code:
 
action_url = host + "/api/action/package_delete"
api_key = 'xxx'
request = urllib2.Request(action_url,'{"id":"testobject4"}')
request.add_header('Authorization', api_key)
response = urllib2.urlopen(request)
 
I think HTTP error no. 403 means that I have no permission for this action.
But why? I used the same api key as I created the package.
 
Can anyone help me?
Thanks
 
John Mrziglod



More information about the ckan-discuss mailing list