Skip to content

Instantly share code, notes, and snippets.

@saulshanabrook
Created June 18, 2014 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saulshanabrook/955ec4bc23ad3c6d435e to your computer and use it in GitHub Desktop.
Save saulshanabrook/955ec4bc23ad3c6d435e to your computer and use it in GitHub Desktop.
Delete Resource from OpenData DC
In [11]: headers
Out[11]:
{'Authorization': '7f99fd94-****',
'Content-Type': 'application/x-www-form-urlencoded'}
In [12]: url
Out[12]: 'http://www.opendatadc.org/api/3/action/resource_delete'
In [13]: requests.post(url, headers=headers, data=json.dumps({'id': 'b0f4af1f-fbd4-45a6-82cd-86fab9140038'})).text
Out[13]: u'{"help": "Delete a resource from a dataset.\\n\\n You must be a sysadmin or the owner of the resource to delete it.\\n\\n :param id: the id of the resource\\n :type id: string\\n\\n ", "success": false, "error": {"message": "Access denied", "__type": "Authorization Error"}}'
@saulshanabrook
Copy link
Author

There doesn't seem to be a delete button the website for resources and the API is not letting me. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment