← Back to team overview

dhis2-devs team mailing list archive

Re: Cannot get individual values from API

 

Hi Ramon,

unfortunately the API cannot currently do exactly what you are asking for.

The dataValueSets
<https://docs.dhis2.org/master/en/developer/html/webapi_data_values.html#webapi_reading_data_values>
API endpoint allows you query by data set and also data element group, if
that is helpful.

Allowing for specifying individual data elements is something we should
offer, so feel free to write an improvement issue at jira.dhis2.org.

best regards,

Lars



On Mon, May 1, 2017 at 4:24 PM, Ramón José Jiménez Pomareta <
dhis2@xxxxxxxxxxx> wrote:

> Thank you for your quick answer, that works !
>
> But for me it doesn't if I don't specify co. Actually, I have a
> dataElement which is divided in three categories options. And so, I must
> call three times dataValues or simply call for the whole dataSet. In both
> cases I have to do the addition. Is there any option to retrieve a
> dataElement directly without specify category options ?
>
> Thank you so much !
>
> 2017-05-01 12:05 GMT+02:00 Knut Staring <knutst@xxxxxxxxx>:
>
>> I think the demo data have been moved from 2013 to more recent years. Try
>> this:
>>
>> https://play.dhis2.org/demo/api/24/dataValues?de=s46m5MS0hxu
>> &pe=201601&ou=DiszpKrYNg8&co=Prlt0C1RF0s
>>
>> On Mon, May 1, 2017 at 11:55 AM, Ramón José Jiménez Pomareta <
>> dhis2@xxxxxxxxxxx> wrote:
>>
>>> Hi,
>>>
>>> I don't know if I didn't get something but I am not be able to retrieve
>>> individual values through the API. The play.dhis2 example doesn't work
>>> neither and it gives me the same answer :
>>>
>>> https://play.dhis2.org/demo/api/24/dataValues?de=s46m5MS0hxu&pe=201301&ou=DiszpKrYNg8&co=Prlt0C1RF0s
>>>
>>> {"httpStatus":"Conflict","httpStatusCode":409,"status":"ERROR","message":"Data value does not exist"}
>>>
>>>
>>> Thank you for your answer,
>>>
>>> Ramón Jiménez Pomareta.
>>>
>>>
>>> _______________________________________________
>>> 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
>> Dept. of Informatics, University of Oslo
>> Norway: +4791880522 <+47%20918%2080%20522>
>> Skype: knutstar
>> http://dhis2.org
>>
>
>
> _______________________________________________
> 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
>
>


-- 
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