SeachApi.PostGroupsSearchAsync got empty result without error

Hi,

When i call PostGroupsSearchAsync with this body:
var body = new GroupSearchRequest()
{
PageSize = 100,
PageNumber = 1,
Query = new List
{
new GroupSearchCriteria
{
Values = groups?.ToList(),
Type = GroupSearchCriteria.TypeEnum.Exact,
Fields = new List { "name" }
}
}
};
It returns an empty result, however the same request got not empty results on the Api Explorer UI. Did i miss some thing in my code? or is there an issue on the .Net SDK?

Are you using client credentials in your .net app? Group visibility is tied to users, so you may not be able to see what you would expect for a user when using non-user authorization.

If you need confirmation why the data is missing, please open a case with Genesys Cloud Care to investigate as we do not have access to your org's data via the forum to investigate missing data.

Hello,
You'are right, it's about visibility of the group, when i make it public i got results.
My question now is: witch permission i need in my client credentials to be able to seach any group of my orgnization?
in the api documentation it is not mentionned: No permissions required
thanks

That's correct, groups aren't controlled by permissions. For non-public groups, a user can only see them if that user is a member. If you're not using user-based authorization, you can't see any private groups. You'll need to switch to a user-based OAuth grant type, which is literally any of them that aren't client credentials. There's an OAuth browser component on nuget to help with that implementation if you're building a desktop app. If you're building a server-side ASP.NET app, use the auth code grant.

1 Like

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