Events API pages for overdue events

Hi team , on this end point https://play.dhis2.org/2.38.4.3/api/events/eventRows.json?orgUnit=DiszpKrYNg8&ouMode[…]W&programStatus=ACTIVE&eventStatus=OVERDUE&pageSize=50&page=1 is there a way have number of pages? secondly filter fields to be displayed , lets same select only few attributes, is it supported ? if now which other endpoint that can achieve same results?

Hi @mutali

Just a curious question, how did you find /event/eventRows? I didn’t know it existed :stuck_out_tongue:

I’d have suggested the endpoint /api/trackedEntityInstances but I wasn’t able to show the paging there as well.

Could you share more about the use case and what the endpoint is supposed to return?

Have you tried using a SQL query instead and then using it as an API request? It might be possible to achieve the result you are looking for.

Thanks!

Hi @mutali

We can use totalPages=true field in the api to get the total count and number of pages.
To have only selected fields in the response, we can use fields field. Here is the details of it.

Thanks & Regards
R.Sri Laxmi Ragini

1 Like

Thanks @Gassim I will try that method as well.
Why I want this is to have the list of overdue events and from there and I created a script to send reminders to the phone number assigned to TEI.

1 Like

Thanks , those parameters do not work on the above endpoint

1 Like

Hello @mutali,

According to the stoplight documentation, paging=true should do the trick. But it does not seem to work for me. Perhaps it is a bug.

1 Like

Thanks for the links and testing @nnkogift!

@mutali the issue has been raised so an update or follow up post should be posted here soon. Thanks for your patience.