← Back to team overview

dhis2-users team mailing list archive

Re: couple questions about dataValueSets API

 

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","period":"201401","orgUnit":"DiszpKrYNg8","dataValues":[{"dataElement":"f7n9E0hX8qk","value":"1"},{"dataElement":"Ix2HsbDMLea","value":"2"}]}'
-u admin:district -v

curl "https://play.dhis2.org/demo/api/24/dataValueSets?importStrategy=DELETE";
-i -X POST -H "Content-Type: application/json" --data
'{"dataSet":"pBOMPrpg1QX","period":"201401","orgUnit":"DiszpKrYNg8","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/>

Follow ups

References