I have working powershell script that uses username and password to run baq to $data, what I need is to figure out how to run the same baq using x-api-key (token). here is working code:
$user = “xxxxxx”
$Pass = “xxxxxx”
#Create encoded password
$secpasswd = ConvertTo-SecureString $pass -AsPlainText -Force
#Create Credential
$cred = New-Object System.Management.Automation.PSCredential ($user, $secpasswd)
$uriPartBin = “https://centralusdtapp46.epicorsaas.com/SaaSxxx/api/v1/BaqSvc/INV-PartBin”
$Data = Invoke-RestMethod $uriPartBin -Method Get -Credential $cred -ContentType “Application/Json”