Public/Curanet/Get-CuranetSubscriptionDetails.ps1
function Get-CuranetSubscriptionDetails() { Param( [Parameter(Mandatory)] [string]$SubscriptionId ) # Get a Curanet 3850 API access token $AccessToken = Get-AccessToken $AuthorizationHeader = @{ Authorization="Bearer $AccessToken" } try { $Subscription = (Invoke-WebRequest -Uri "https://api.curanet.dk/subscriptions/v1/Subscriptions/$($SubscriptionId)" -Headers $AuthorizationHeader -UseBasicParsing -Method GET).Content | ConvertFrom-Json } catch { Write-Error "Failed to retreive subscription details from Curanet 3850 API: $_" } return $Subscription } |