API Working partially

Hi all,

The following API is not fetching the data elements within each sections. In other words I am able to get the name of the program, Name of the program stage and Name of the program stage sections, but the data elements within each section are not displayed.

https://…/api/29/programs.json?&fields=id,name,programStages[id,name,programStageSections[id,name,programStageDataElements[dataElement[id,name]]]&paging=false

Is there anything wrong?

We are using DHIS 2 version 2.40.2.1

Thanks

I believe within programStageSections, the relevant property is dataElements, not programStageDataElements, so you probably want a

if you want data element information by section
/api/programs.json?&fields=id,name,programStages[id,name,programStageSections[id,name,dataElements[id,name]]&paging=false

if you want data element information for the whole program:

/api/programs.json?&fields=id,name,programStages[id,name,programStageSections[id,name],programStageDataElements[dataElement[id,name]]&paging=false

Hi @tzemp,

It is working well.

Thank you.

1 Like