Win 2022, client/v4/user powershell API call fails. I am unaware of why this should be failing. Brand new token. I am domain/zone owner.
Test Base URI by fetching user details
try {
$userResponse = Invoke-RestMethod -Uri “$baseUri/user” -Method Get -Headers $headers
Write-Output “Authenticated User: $($userResponse.result.email)”
} catch {
Write-Output “Failed to authenticate or access Cloudflare API base URI (user).”
exit
$baseUri = “https://api.cloudflare.com/client/v4”
Bearer Token provided.