Unable to list all TEI's using the API - paging=false being ignored

I’d like to list all TEI’s of a particular type using the API but it only displays 50 at a time despite the paging=false setting:

I’m attempting to get the TEI UID for all TEIs so I can register them in a program by import but can’t get the TEI list. I assume it’s not possible to enroll a TEI in a program at the same time as generating the TEI - I’m doing it in a 2-step process and while the registration seems to work, I can’t then get the TEI UID to register each individual in a program.

Right now, without this working, and no direct DB access, I’m struggling to see how one is able to import TEIs and enrollments in bulk as enrollments require the TEI (UID) to be supplied.

EDIT For anyone else struggling with this, try adding pageSize=10000 (or other suitably large number) and page=1 to the query to work around it… like this:

See solution above
“try adding pageSize=10000 (or other suitably large number) and page=1 to the query to work around it…”

Thanks @matthew_deas

Just to update this since i’ve heard back from the dev team. It seems it’s a bit more nuanced. this from @lina

Hi @Ed Robinson . We’d highly discourage the use of paging=false overall. That parameter is valid in the new Tracker API (from v41, not lower), so the request would look different than the one you shared: Login app | DHIS2 (skipPaging=true also would work but it is being deprecated soon).

In the example you reported, you’re using the old Tracker API (this will be deprecated from v42), there paging=false is not valid, you should use skipPaging=true instead (that returns all results): DHIS 2 Demo - Sierra Leone

Hope this explains how to use it and clarifies the differences. Documentation should be up to date (if you refer to the versions you’re using), just a note that there is old Tracker API and new one and their requests may differ.

Thanks to @Ameen & @enrico for your consultation.

1 Like

Thank you @Edward_Robinson for sharing the solution, and thanks @matthew_deas for being here for the community! :clap:

1 Like

I’ve updated the solution to include more info from the dev team.
Thanks to all

1 Like