5pm-HDH / churchtools-api

The Churchtools-API Client is a wrapper for the churchtools-api written in PHP.
MIT License
18 stars 8 forks source link

API broken: Group Hierarchie #183

Closed DumbergerL closed 8 months ago

DumbergerL commented 9 months ago

The ChurchTools API Endpoint /api/groups/hierarchies?ids%5B%5D=9 is broken.

TODO: Create Support Ticket for ChurchTools

djschilling commented 9 months ago

I think that is just a misunderstanding. The returned groups must match all filters. So if the child or the parent is not part of the filter nothing is returned. So if you just provide one Id there cannot be returned anything.

DumbergerL commented 9 months ago

Thank you @djschilling! That clears up some of my confusion. This means that if I want to retrieve the hierarchy of a single group, I must first retrieve the entire hierarchy of all groups (maybe filtered to the group type) and then filter out the relevant groups in the code?

djschilling commented 9 months ago

For this use case you can use /groups/{groupId}/children or /groups/{groupId}/parents