Skip to content

Instantly share code, notes, and snippets.

@saulshanabrook
Created June 16, 2014 18:39
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/98425ea1b91f2f9a35c8 to your computer and use it in GitHub Desktop.
Save saulshanabrook/98425ea1b91f2f9a35c8 to your computer and use it in GitHub Desktop.
Open Data DC API Data Upload
$ http POST http://www.opendatadc.org/api/3/action/resource_update id=4010146d-bf4f-4c42-a838-20a1ab86945e id=techforelissa Authorization:4010146d-****
HTTP/1.1 404 Not Found
Access-Control-Allow-Headers: X-CKAN-API-KEY, Authorization, Content-Type
Access-Control-Allow-Methods: POST, PUT, GET, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Cache-Control: no-cache
Content-Length: 441
Content-Type: application/json;charset=utf-8
Date: Mon, 16 Jun 2014 18:43:28 GMT
Pragma: no-cache
Server: Apache/2.2.22 (Ubuntu)
{
"error": {
"__type": "Not Found Error",
"message": "Not found: Resource was not found."
},
"help": "Update a resource.\n\n To update a resource you must be authorized to update the dataset that the\n resource belongs to.\n\n For further parameters see ``resource_create()``.\n\n :param id: the id of the resource to update\n :type id: string\n\n :returns: the updated resource\n :rtype: string\n\n ",
"success": false
}
@saulshanabrook
Copy link
Author

@saulshanabrook
Copy link
Author

Do you know why this is giving me a 404?

@saulshanabrook
Copy link
Author

Ooops I was passing the wrong ID.

$ http POST http://www.opendatadc.org/api/3/action/resource_update id=4010146d-bf4f-4c42-a838-20a1ab86945e upload='test' Authorization****
HTTP/1.1 403 Forbidden
Access-Control-Allow-Headers: X-CKAN-API-KEY, Authorization, Content-Type
Access-Control-Allow-Methods: POST, PUT, GET, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Cache-Control: no-cache
Content-Length: 424
Content-Type: application/json;charset=utf-8
Date: Mon, 16 Jun 2014 18:54:50 GMT
Pragma: no-cache
Server: Apache/2.2.22 (Ubuntu)

{
    "error": {
        "__type": "Authorization Error",
        "message": "Access denied"
    },
    "help": "Update a resource.\n\n    To update a resource you must be authorized to update the dataset that the\n    resource belongs to.\n\n    For further parameters see ``resource_create()``.\n\n    :param id: the id of the resource to update\n    :type id: string\n\n    :returns: the updated resource\n    :rtype: string\n\n    ",
    "success": false
}

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