[ckan-dev] Upload using resource_create via API

Stéphane Guidoin stephane at opennorth.ca
Fri Jan 24 17:18:34 UTC 2014


Are you able to use Python? The python example in the same page (
http://docs.ckan.org/en/latest/filestore.html?highlight=upload#filestore-api)
work (except for a quote not correctly placed).

Steph


On Fri, Jan 24, 2014 at 12:14 PM, Marcelo Rezende <malvre at gmail.com> wrote:

> I can't do that... request with multipart must pass parameters one by one
> with -F argument. passing parameters with -d works, but without upload,
> just for register a URL
>
>
>
>
> 2014/1/24 Ross Jones <ross at servercode.co.uk>
>
>> 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
>>
>>
>>
>> _______________________________________________
>> 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
>>
>>
>
>
> --
>
> 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
>
>


-- 
Stéphane Guidoin
Director, Transportation
Open North
514-862-0084
http://opennorth.ca
Twitter: @opennorth / @hoedic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140124/c50a5252/attachment-0003.html>


More information about the ckan-dev mailing list