#This Qualtrics API call only returns surveys accessible to the user holding the token, not all surveys in the tenant. #Define headers and API endpoint. $headers = @{ "X-API-TOKEN" = yourapitoken } $qualtrics_api_url = "https://yourdatacenter.qualtrics.com/API/v3" $endpoint = "surveys" $uri = $qualtrics_api_url+"/"+$endpoint #Create an empty array and fill it. $surveys = @() $result = Invoke-RestMethod -Method Get -Uri $uri -Headers $headers $surveys += $result.result.elements #If pagination is required, change the query URI to the nextPage property returned in the previous loop. while($result.result.nextPage){ $result = Invoke-RestMethod -Method Get -Uri $result.result.nextPage -Headers $headers $surveys += $result.result.elements Write-Host "." -NoNewline -ForegroundColor Green } return $surveys