API request empty objects

Hi all,

I want to get all tracked entities’ names of a specific tracker program and org- unit and its descendants. I tried this API but it giving an error.

https://play.dhis2.org/2.38.6/api/33/trackedEntityInstances.json?fields=[name]&program=IpHINAT79UW&ou=DiszpKrYNg8

Thanks

1 Like

Hi @ferdinandmussavene

The fields parameter in the request needs to be modified a bit because the result doesn’t return ‘name’ directly; for example, fields=attributes[displayName,value] will return the names from the TE attributes.

Here’s a slight modification:

https://play.dhis2.org/2.38.6/api/33/trackedEntityInstances.json?fields=attributes[displayName,value]&program=IpHINAT79UW&ou=DiszpKrYNg8

Hope this helps! :slight_smile: