Public/Invoke-GCGroupsSearch.ps1
|
<# .SYNOPSIS Searches for groups in Genesys Cloud. .DESCRIPTION Performs a group search in Genesys Cloud by sending a POST request with search criteria. Supports complex search queries with multiple fields, sorting, and pagination. API Endpoint: POST /api/v2/groups/search .PARAMETER Body The request body containing the search criteria. Accepts a hashtable or JSON string. Should include a 'query' array with search terms and optionally 'sortOrder', 'sortBy', 'pageSize', and 'pageNumber'. .EXAMPLE Invoke-GCGroupsSearch -Body @{ query = @(@{ type = 'EXACT'; fields = @('name'); values = @('Support Team') }) } Searches for groups with the exact name 'Support Team'. .EXAMPLE Invoke-GCGroupsSearch -Body @{ query = @(@{ type = 'CONTAINS'; fields = @('name'); value = 'Support' }); pageSize = 50 } Searches for groups whose name contains 'Support'. .NOTES Genesys Cloud API: POST /api/v2/groups/search #> function Invoke-GCGroupsSearch { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [object]$Body ) $endpoint = "groups/search" return Invoke-GCApiRequest -Endpoint $endpoint -Method POST -Body $Body } |