Hi All,
I’m doing some testing with PowerShell’s Invoke-RestMethod & WHD rest api around creating tech notes for pre-existing tickets & am having no luck. When I run the bellow script, I receive the following error: Invoke-RestMethod : This operation is not permitted due to invalid Subscriber ID. The Subscriber of the JobTicket entity has to match the current users's Subscriber.
Script:-
$test = @{
noteText= "Test"
jobticket= @{
Type="JobTicket"
ID="11678"
}
worktime="1"
isHidden="false"
isSolution="false"
statusTypeId= "1"
emailClient= "false"
emailTech= "false"
emailTechGroupLevel= "false"
emailGroupManager= "false"
emailCc= "false"
emailBcc= "false"
ccAddressesForTech= "false"
bccAddresses=""
}
$json = $test | ConvertTo-JsonInvoke-RestMethod whd/.../TechNotes -Method POST -Body $json -ContentType "application/json" -Verbose
I'm assuming I am doing something wrong, can anyone point me in the right direction?
Message was edited by: Brad Cope Grammar