Public/Get-GW2AccountWizardsVaultListings.ps1

<#
.SYNOPSIS
Retrieves the account's Wizard's Vault listings (Astral Rewards) using a provided API key.
 
.DESCRIPTION
Calls the Guild Wars 2 API v2 /account/wizardsvault/listings endpoint and returns the deserialized object containing the account's Wizard's Vault listings. The function issues an authenticated GET request.
 
.PARAMETER APIKey
The Guild Wars 2 API key (string) to authenticate the request. Requires 'account' and 'progression' scopes.
 
.EXAMPLE
Get-GW2AccountWizardsVaultListings -APIKey 'your_api_key_here'
 
.NOTES
- Requires network access to api.guildwars2.com.
- Ensure the API key has the necessary scopes.
#>

function Get-GW2AccountWizardsVaultListings {
    param (
        [string]$APIKey
    )
    $headers = @{
        "Authorization" = "Bearer $APIKey"
    }
    $url = "https://api.guildwars2.com/v2/account/wizardsvault/listings"
    $response = Invoke-RestMethod -Uri $url -Method Get -Headers $headers
    
    return $response
}