For my tracker program, I would like to query for Tracked Entity attributes (name, age, gender, etc) and data elements of a specific program stage or program in the same request. I have read pages about Event query analytics in the Developer Manual, but I couldn’t get what want.
I am wondering if you help me with a nested web api code to retrieve TE attributes, data elements, and option sets.
First, there are two main requirements to get the TEI: OU & program (and you could get their IDs from the Maintenance app), and then for your request I used the fields parameter to choose what I want to be displayed which in this case is attributes. I could have chosen to just keep it as fields=attributes; however, if I don’t want to see all the details such as “lastUpdated”…etc then I could specify what I want in closed brackets such as fields=attributes[displayName,value]. You could start with fields=* to all the possible selections and then choose the info you want.
The shared APIs do really help. But what about if I want to display, a part from attributes, data elements values of a specific program stage or all program stages in the same API. is this possible?
Then you’d have to use the “programs” resource (to check all available resources, click here) and I have not tested using more than one resource in the same API URL request, but it’s possible for App developers to create such queries.
Sounds to me like you’re describing a sqlView query that you could build and then execute? I’m no expert in sql, but that’s where I’d be going—in essence it sounds like you want to join two + tables together within a single request.