API enrollments visualization

Hi all,

I want to view some attributes (name, gender) of all enrollments in a certain program assigned to an org unit (including its descendants).
Could you help me change this API to get my desired result?


Hi @fernandoshake,
The API request you posted helped, thanks! You were doing it correctly except the endpoint you used in enrollments, but to be able to view the attributes, you’d need to use the trackedEntityInstances endpoint:

Hi @Gassim,

Thank you. The API request does work very well, but when I try to display the result as csv, it show an empty file. I just added csv extension after TrackedEntityInstances. Is it correct to put csv before question mark?


Hi @fernandoshake

Please what’s not working very well. Do you get the desired result when using .json?

You are right! Would you like to create a jira bug issue on jira.dhis2.org?

Thank you!

Hi @Gassim ,

Using json, I get the result. Why not in csv?


Yes sorry this is a bug issue. I have created a Jira bug issue here: Log in - DHIS 2 JIRA

You can ‘watch’ this issue for updates/comments, and add your vote to prioritize. :+1:

Perhaps a small aside, but do be really really careful about setting paging=false like this. If this was a vaccination campaign with potentially 10s of millions of TEIs, you can easily crash the server like this. Rule of thumb : always use paging.

1 Like

Yes! Thanks!:+1:


Without the paging=false, and maybe replace it with pageSize=[number of items to be displayed]