API Call to all tracked entity instances

Hello community,
is there a way I can call all TEI in an instance without caring about program or orgUnit,
I mean if there a way I can call all TEIs that exists in an instance, thank you

1 Like

Hi @Pacifique_Hategekima ,

You can use something like this.

https://play.dhis2.org/2.38.1.1/api/trackedEntityInstances.json?trackedEntityType=nEenWmSyUEp&ou=ImspTQPwCqd&ouMode=DESCENDANTS&pageSize=1000

trackedEntityType → The TrackedEntity you want to get the details
ou → You can mention the UID of the root Org unit
ouMode → This should be DESCENDANTS so that all the descendants of the root org unit are included
pageSize → an arbitrary number to get all the results (currently paging=false is broken in 2.38.1.1). If pageSize is not mentioned, you will only get 50 results.

Thanks,
Rithvik

4 Likes

Thank you this is so helpful

1 Like