# Get detailed error from action-mappings endpoint $token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6OTk5OTk5OTk5OX0.L8PNFqKLDqPyPpkcVVQcEbWrDh1FJ7BfZ7DsN0F8_jM" # Login first $loginBody = @{ username = "admin" password = "admin123" } | ConvertTo-Json try { $loginResponse = Invoke-WebRequest -Uri "http://localhost:8000/api/v1/auth/login" ` -Method POST ` -Body $loginBody ` -ContentType "application/json" ` -UseBasicParsing $loginData = $loginResponse.Content | ConvertFrom-Json $token = $loginData.access_token Write-Host "Logged in successfully" -ForegroundColor Green } catch { Write-Host "Login failed: $($_.Exception.Message)" -ForegroundColor Red exit 1 } # Try action-mappings and capture error details try { $response = Invoke-WebRequest -Uri "http://localhost:8000/api/v1/configuration/action-mappings" ` -Headers @{ "Authorization" = "Bearer $token" "Content-Type" = "application/json" } ` -Method GET ` -UseBasicParsing Write-Host "Success: $($response.StatusCode)" -ForegroundColor Green } catch { Write-Host "Error Status Code: $($_.Exception.Response.StatusCode.Value__)" -ForegroundColor Red Write-Host "Error Message: $($_.Exception.Message)" -ForegroundColor Red # Try to read response body $reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream()) $errorBody = $reader.ReadToEnd() Write-Host "`nError Body:" -ForegroundColor Yellow Write-Host $errorBody }