dhis2-users team mailing list archive
-
dhis2-users team
-
Mailing list archive
-
Message #11987
Re: couple questions about dataValueSets API
You are right, Morten. It works with --data-binary instead of -d.
Thanks!
On 8 December 2016 at 03:28, Morten Olav Hansen <morten@xxxxxxxxx> wrote:
> Hi
>
> Do you get any errors? it should be possible, it will take the first file
> in the zip file and use that (so it would be best to always only have one
> file)
>
> Could you also try with --data-binary instead of -d ?
>
> --
> Morten Olav Hansen
> Senior Engineer, DHIS 2
> University of Oslo
> http://www.dhis2.org
>
> On Thu, Dec 8, 2016 at 1:18 AM, Victor Garcia <vgarciabnz@xxxxxxxxx>
> wrote:
>
>> Hi,
>>
>> about importing datavalues in zip format, I think it is possible since it
>> was fixed in 2.21 (https://lists.launchpad.net/dhis2-devs/msg46144.html).
>> I am able to import a zip file using Postman and using our own webapp both
>> in 2.21 and 2.25, so it seems to be working fine.
>>
>> On the other hand, I am not able to import a zip file using curl with the
>> command:
>>
>> curl.exe -d @test.zip -H "Content-Type: application/json" -X POST "
>> http://localhost/api/dataValueSets" -u user:password -v
>>
>> but I guess I am missing something...
>>
>> Regards!
>>
>> On 6 December 2016 at 13:39, Vladimer Shioshvili <vshioshvili@xxxxxxxxx>
>> wrote:
>>
>>> Thanks Lars. It was a human error issue, input i was testing with has
>>> duplicates and i was looking at ignored, and not noticing the delete count.
>>> Thanks!
>>>
>>> What would be the level of effort and ability to back port to 2.24 of
>>> supporting compressed files in API?
>>>
>>> On Tue, Dec 6, 2016 at 6:42 AM Lars Helge Øverland <lars@xxxxxxxxx>
>>> wrote:
>>>
>>>> Hi Vlad,
>>>>
>>>>
>>>>
>>>> On Tue, Dec 6, 2016 at 12:04 PM, Vladimer Shioshvili <
>>>> vshioshvili@xxxxxxxxx> wrote:
>>>>
>>>> 1) just to confirm, web api only accets uncompressed file, right? and
>>>> it's the import/export app that is capable of handling zip file?
>>>>
>>>>
>>>> Yes that is correct per now. We could consider adding that support to
>>>> the API as well.
>>>>
>>>>
>>>>
>>>> 2) does DELETE import strategy work for dataValueSets? I have not been
>>>> able to get it to work.
>>>>
>>>>
>>>> It seems to be working - try running the two curl commands below, which
>>>> indicates that data gets added and then removed.
>>>>
>>>>
>>>> curl "https://play.dhis2.org/demo/api/24/dataValueSets" -i -X POST -H
>>>> "Content-Type: application/json" --data '{"dataSet":"pBOMPrpg1QX","per
>>>> iod":"201401","orgUnit":"DiszpKrYNg8","dataValues":[{"dataEl
>>>> ement":"f7n9E0hX8qk","value":"1"},{"dataElement":"Ix2HsbDMLea","value":"2"}]}'
>>>> -u admin:district -v
>>>>
>>>> curl "https://play.dhis2.org/demo/api/24/dataValueSets?importStra
>>>> tegy=DELETE" -i -X POST -H "Content-Type: application/json" --data
>>>> '{"dataSet":"pBOMPrpg1QX","period":"201401","orgUnit":"Diszp
>>>> KrYNg8","dataValues":[{"dataElement":"f7n9E0hX8qk","value":"
>>>> 1"},{"dataElement":"Ix2HsbDMLea","value":"2"}]}' -u admin:district -v
>>>>
>>>>
>>>>
>>>> regards,
>>>>
>>>> Lars
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> I am running on 2.24, if it makes a difference.
>>>>
>>>> Thanks,
>>>> Vlad
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~dhis2-users
>>>> Post to : dhis2-users@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~dhis2-users
>>>> More help : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Lars Helge Øverland
>>>> Lead developer, DHIS 2
>>>> University of Oslo
>>>> Skype: larshelgeoverland
>>>> lars@xxxxxxxxx
>>>> http://www.dhis2.org <https://www.dhis2.org/>
>>>>
>>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~dhis2-users
>>> Post to : dhis2-users@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~dhis2-users
>>> More help : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-users
>> Post to : dhis2-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> More help : https://help.launchpad.net/ListHelp
>>
>>
>
Follow ups
References