# Test the action-categories endpoint # Login $loginResponse = Invoke-RestMethod -Uri "http://localhost:8000/api/v1/auth/login" ` -Method POST ` -Body (@{username="admin"; password="admin123"} | ConvertTo-Json) ` -ContentType "application/json" $token = $loginResponse.access_token Write-Host "Logged in successfully" -ForegroundColor Green # Test action-categories endpoint Write-Host "`nTesting /api/v1/configuration/action-categories..." -ForegroundColor Cyan try { $response = Invoke-RestMethod -Uri "http://localhost:8000/api/v1/configuration/action-categories" ` -Headers @{Authorization = "Bearer $token"} ` -Method GET Write-Host "Success!" -ForegroundColor Green Write-Host "Total categories: $($response.total_categories)" -ForegroundColor Yellow Write-Host "Total actions: $($response.total_actions)" -ForegroundColor Yellow Write-Host "`nCategories and their actions:" -ForegroundColor Cyan foreach ($category in ($response.categories.PSObject.Properties.Name | Sort-Object)) { $actions = $response.categories.$category Write-Host "`n=== $category ($($actions.Count) actions) ===" -ForegroundColor Yellow foreach ($action in $actions) { Write-Host " - $action" -ForegroundColor White } } } catch { Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red if ($_.Exception.Response) { $reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream()) $errorBody = $reader.ReadToEnd() Write-Host "`nError Body:" -ForegroundColor Yellow Write-Host $errorBody } }