[ckan-dev] Upload using resource_create via API

Ross Jones ross at servercode.co.uk
Fri Jan 24 16:36:32 UTC 2014


Hi,

I think the package_id has to be passed as json in the body for create, try the following (where I’ve replaced -F package_id=:

curl http://dados.rs.gov.br/api/action/resource_create -H "Authorization:<my auth key>" -F upload=@/Users/rezende/Desktop/menu.json -d '{"package_id":"testeopendata6”}'

This is based on the example in the docs that uses resource_create.  I think resource_update allows the resource_id as a form parameter.

Ross


On 24 Jan 2014, at 16:19, Marcelo Rezende <malvre at gmail.com> wrote:

> I'm trying to create a resource uploading a file via API, but return JSON decoding error. CKAN version is 2.2a
> 
> my command line:
> 
> curl http://dados.rs.gov.br/api/action/resource_create -H "Authorization:<my auth key>" -F upload=@/Users/rezende/Desktop/menu.json -F package_id=testeopendata6
> 
> 
> I did as the doc: http://docs.ckan.org/en/latest/filestore.html?highlight=upload#filestore-api
> 
> anyone else had this problem?
> 
> -- 
> 
> Marcelo Rezende
> malvre at gmail.com
> http://malvre.com
> 
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140124/1a3d2fa8/attachment-0003.html>


More information about the ckan-dev mailing list