← Back to team overview

dhis2-devs-core team mailing list archive

Re: Small api issues with the users endpoint

 

Small correction on the one before. The oddity with the filtering and paging only happens when paging is less than 5, not equal to 5.

When above 9 it gives 3 users actually.

It seems to do filtering before paging.

The first two users are on:
https://apps.dhis2.org/dev/api/users.json?pageSize=10&filter=name:like:John&page=1

The third user is on:
https://apps.dhis2.org/dev/api/users.json?pageSize=10&filter=name:like:John&page=2

Regards,

Mark

On 9 Jun 2015, at 14:41, Mark Polak <markpo@xxxxxxxxxx<mailto:markpo@xxxxxxxxxx>> wrote:

Hey Morten,

Some small things i found when "API-ing".

None of these things are really urgent. The paging thing i would say would be the highest priority as it breaks the paging for the DATIM user app. (When users filter on certain stuff, the page numbers will always stay the same)

User endpoint paging (demo & dev):

The pager still gives information for all the users in the system, even when filtering is applied.

https://apps.dhis2.org/dev/api/users.json?pageSize=10&filter=name:like:John
https://apps.dhis2.org/demo/api/users.json?pageSize=10&filter=name:like:John

User endpoint oddity

While creating the examples above i noticed something else that is a bit odd.

pageSize of 5 or lower returns 1 result
https://apps.dhis2.org/demo/api/users.json?pageSize=5&filter=name:like:John

pageSize of 6 or more returns 2 results
https://apps.dhis2.org/demo/api/users.json?pageSize=6&filter=name:like:John

Organisation units endpoint sorting combined with special level attribute

When using the special level=3 parameter the sort parameter does not work anymore (I guess this has to do something with that the level thing does some special query stuff)

Correctly sorts by name
https://apps.dhis2.org/demo/api/organisationUnits.json?filter=level:eq:3&sort=name:asc

Sorting by name stop sorting
https://apps.dhis2.org/demo/api/organisationUnits.json?level=3&sort=name:asc

Pager does not respect filtering (Any endpoint)

When requesting a url like the following the nextPage attribute of the pager omits the filter from the nextPage. This makes the nextPage not reliable for trying to get the next page. I'd have to re-add the filters for each previous or next page.
https://apps.dhis2.org/demo/api/dataElements.json?filter=name:like:A

Regards,

Mark


Follow ups

References