Hello. I'm trying to access the SD token needed for schedules access using Windows Powershell.

If anyone has any experience or wisdom on how to do this, I would appreciate the help.

This is what I've tried so far but with no success:

$sdUID = 'abcdef'
$sdPW = Get-StringHash -String "123456" -HashName "SHA1"
$sdPW = $sdPW.ToLower()
$jhsdLogin = @{"username"= $sdUID; "password"= $sdPW} | ConvertTo-Json

$sdUAgent = [Microsoft.PowerShell.Commands.PSUserAgent]::InternetExplorer
$sdContentType = "application/json;charset=UTF-8"

$sdToken = Invoke-WebRequest -Uri https://json.schedulesdirect.org/20141201/token -UseBasicParsing -Method Post -Body $jhsdLogin -UserAgent $sdUAgent -ContentType $sdContentType -Debug

This snippet results in "400 Bad Input."

I've also posted on the SchedulesDirect Developer forum.

Thank you.