Searching groups by visibility

I'm using the search endpoint and want to get only groups that are visible publicly.

So I POST to /api/v2/groups/search with content

{"query":[{"type":"EXACT","value":"public","fields":["visibility"]}]}

And I get 0 results. If I login on the API explorer, it only lists 4 fields to search on for a group: name, description, id and state.

So.. if the API explorer is correct, shouldn't my search return in an error telling me I specified the wrong field? And else, I should be getting some results, no?

Hi @ssteiner

Blockquote
So.. if the API explorer is correct, shouldn't my search return in an error telling me I specified the wrong field? And else, I should be getting some results, no?

That's not how the search resources are designed. They won't throw an error based on the field in the search criteria, but you won't get results for those. The dropdowns for viable search fields were developed working closely with the search team, so they are pretty accurate. But the lack of hard limits on the search fields allows for some flexibility for the search team and end users.

Consider suggesting the addition of a search field or a query param for the list resource that filters on visibility. You can do that here if you decide to.
https://genesyscloud.ideas.aha.io/portal_session/new

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.