API query: /api/tracker/trackedEntities with all information

Hi all,

How can I get the following information through an API query: tracked entity instances attribute values and all the information (data element names and the values entered on them, etc ) of one specific program stage and filter by event date.

Regards

Would something like this work for you?

https://play.im.dhis2.org/stable-2-41-2/api/tracker/trackedEntities?program=IpHINAT79UW&programStage=A03MvHHogjR&fields=*&eventOccurredAfter=2023-01-01&eventOccurredBefore=2024-01-01&eventStatus=COMPLETED

1 Like

Hi @claude.mamo,

When I run the API, I get the following error:

{“httpStatus”:“Conflict”,“httpStatusCode”:409,“status”:“ERROR”,“message”:“At least one organisation unit must be specified”}

I inserted an org unit Id after fields=, eg fields=&ou=yK7GJ6N7WM8& but it is not working.

Thanks

Which version of DHIS2 are you testing with?

Hi @claude.mamo,

The DHIS 2 version is 2.40.6

Thanks

It appears that the organisation unit is required for the version of DHIS2 you are using. Replacing ou with orgUnit in your query should give the expected results: Tracker - DHIS2 Documentation

1 Like

@fernandoshake can I mark my reply as a solution?

1 Like