I'm trying to follow the documentation Web Help Desk REST API Guide to authenticate with a sessionKey using PowerShell. I've tried the same steps in PowerShell, CURL, and the Postman API test bench - all return the same failure.
I'm able to successfully acquire the sessionKey by issuing a request like this:
Invoke-WebRequest -Uri "https://<WHD URL>/helpdesk/WebObjects/Helpdesk.woa/ra/Session?username=WHDAdmin&apiKey=<hidden>" |
The response is valid JSON, and contains what appears to be a valid session key:
{"type":"Session","sessionKey":"<sessionKey>","currentTechId":1,"instanceId":-1} |
Then I issue the request for a ticket:
Invoke-WebRequest -Uri "https://<WHDURL>/helpdesk/WebObjects/Helpdesk.woa/ra/Tickets/100?sesionKey=<sessionKey from last step>" |
The response is not a JSON object of the requested ticket as expected, but rather an error:
Invoke-WebRequest : Authentication required. At line:1 char:1 + Invoke-WebRequest -Uri "https://<WHDURL>/helpdesk/WebO ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand |
Has anyone successfully used the sessionKey authentication method against a WHD instance?
Any help would be appreciated.
Thanks,