Public/Get-GCUserRoles.ps1
|
<# .SYNOPSIS Retrieves the roles assigned to a subject in Genesys Cloud. .DESCRIPTION Queries the Genesys Cloud API to retrieve the authorization roles assigned to a specific subject (user or group). Returns the list of roles and their associated divisions. API Endpoint: GET /api/v2/authorization/subjects/{subjectId}/roles .PARAMETER SubjectId The unique identifier of the subject (user or group) whose roles to retrieve. .EXAMPLE Get-GCUserRoles -SubjectId '12345678-1234-1234-1234-123456789012' Retrieves all roles assigned to the specified subject. .NOTES Genesys Cloud API: GET /api/v2/authorization/subjects/{subjectId}/roles #> function Get-GCUserRoles { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$SubjectId ) $endpoint = "authorization/subjects/$SubjectId/roles" return Invoke-GCApiRequest -Endpoint $endpoint -Method GET } |