dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #51467
Re: Uploading CSV data file with curl
Hi Leke, are you sending METADATA or DATA VALUES?
If the latter, you need to use dataValueSets:
https://docs.dhis2.org/master/en/developer/html/webapi_data_values.html#webapi_sending_data_values
Knut
On Wed, Jul 4, 2018 at 5:58 AM Olaleke Seweje <sewejeolaleke@xxxxxxxxx>
wrote:
> Hi all,
>
> I am trying to upload data via CURL as specified in the dev docs - 1.9.2. Creating
> and updating objects. My request is as follows:
>
>
> curl -d @file._name.csv "http://myHostName/api/26/dataElements" -X POST
> "Content-Type: application/csv" -u username:password
>
>
>
> *The response I got was *
>
>
> {"httpStatus":"Unsupported Media
> Type","httpStatusCode":415,"status":"ERROR","message":"Content type
> 'application/x-www-form-urlencoded' not supported"}curl: (6) Could not
> resolve host: Content-Type
>
> I have tried content type text/csv as well but got similar results.
>
> My questions
> 1. Is my endpoint http://myHostName/api/26/dataElements the correct one
> for uploading data values via API?
>
> 2. Is the request format correct?
>
> 3. Is there something I need to set on my DHIS instance to make it support
> such operations?
>
> Thanks for your help.
>
>
> --
> Regards,
> Leke Seweje
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help : https://help.launchpad.net/ListHelp
>
--
Knut Staring
Department of Information, Evidence and Research
World Health Organization, Geneva, Switzerland
Office: +41 22 791 3683 Mob1: +33 6 4434 2931 Mob2: +47 9188 0522
Skype: knutstar
References