Public/Get-GCFlowsDatatableRows.ps1

<#
.SYNOPSIS
    Retrieves rows from a flow datatable in Genesys Cloud.

.DESCRIPTION
    Queries the Genesys Cloud API to retrieve a paginated list of rows from a specific flow datatable.
    API Endpoint: GET /api/v2/flows/datatables/{datatableId}/rows

.PARAMETER DatatableId
    The unique identifier of the datatable to retrieve rows from.

.PARAMETER PageSize
    The number of results per page. Default is 25.

.PARAMETER PageNumber
    The page number to retrieve. Default is 1.

.EXAMPLE
    Get-GCFlowsDatatableRows -DatatableId 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'
    Retrieves the first page of rows from the specified datatable.

.EXAMPLE
    Get-GCFlowsDatatableRows -DatatableId 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' -PageSize 100
    Retrieves 100 rows from the specified datatable.

.NOTES
    Genesys Cloud API: GET /api/v2/flows/datatables/{datatableId}/rows
#>

function Get-GCFlowsDatatableRows {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [string]$DatatableId,

        [Parameter(Mandatory = $false)]
        [int]$PageSize = 25,

        [Parameter(Mandatory = $false)]
        [int]$PageNumber = 1
    )

    $queryParams = @{
        pageSize   = $PageSize
        pageNumber = $PageNumber
    }

    $endpoint = "flows/datatables/$DatatableId/rows"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method GET -QueryParameters $queryParams
}