AutotaskAPI icon indicating copy to clipboard operation
AutotaskAPI copied to clipboard

Connecting to the Autotask API failed. The remote server returned an error: (401) Unauthorized.

Open jjwerkman opened this issue 2 months ago • 4 comments

Any idea why 'Get-Credential' (and enter credentials manually) works but using this code doesn't?

$ApiUser = "[API-username]" $ApiSecret = ConvertTo-SecureString "[API-password]" -AsPlainText -Force $Creds = New-Object System.Management.Automation.PSCredential ($ApiUser, $ApiSecret)

Connection looks succesfull but as soon as I run a command like "Get-AutotaskAPIResource -Resource Companies -ID 1899" I get the error as mentioned in the title.

jjwerkman avatar Nov 05 '25 10:11 jjwerkman