Skip to content

Instantly share code, notes, and snippets.

@jdmills-edu
Created September 21, 2017 14:24
Show Gist options
  • Save jdmills-edu/c309855370a9fdf34ac2ea99d3876e0c to your computer and use it in GitHub Desktop.
Save jdmills-edu/c309855370a9fdf34ac2ea99d3876e0c to your computer and use it in GitHub Desktop.
A PowerShell script that authenticates to the Team Dynamix API and returns a JSON Web Token. A prerequisite for any further queries to the TDX API.
$url = "https://yourdomain.teamdynamix.com/TDWebApi/api"
$action = "/auth/loginadmin"
$endpoint = $url+$action
$request = '{
"BEID": "YourTDXAPIBEID",
"WebServicesKey": "YourWebServicesKey"
}'
$jwt = Invoke-RestMethod -Method Post -Uri $endpoint -Body $request -ContentType "application/json; charset=utf-8"
return $jwt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment