Powershell REST API operations
After a lot of searching I found the answer to my original question below. Thanks to Marcin in
this topic!
- $SDLink = "http://localhost:8080/"
- $api="sdpapi/request?"
- $format="json"
- $APIKey = "<Your API-key>"
- $inputData = @{
- operation=
- @{details=
- @{subject="Servicedesk Plus MSP example";
- description="Yay! I'am able post a request with PowerShell!";
- requester="John Doe";
- site="Sample Site";
- account="Sample Account"
- }
- }
- } |ConvertTo-Json
- $URI=$SDLink+$api
- $postParams = @{TECHNICIAN_KEY=$($APIKey);data=$($inputData);format=$($format)}
- Invoke-WebRequest -Uri $URI -Body $postParams -Method POST -TimeoutSec 10
- write-host $SDLink
Dear MSP users,
Anyone succesfully managed to use REST API operations with Powershell? If so, do you have a sample script to add and edit a request? Thanks in advance! ;-)
Kind regards,
Kerim Berkeveld
New to ADSelfService Plus?