Update ticket using powershell

Hello all, I'm posting this question here in the hopes that somebody can point me to the right direction. I should say that I have a beginner knowledge of powershell and api. We are using Web Help Desk version 12.5.2.

What I want to accomplish is to create ticket and update ticket using powershell script. I am able to issue a Get method no problem. But if I issue a POST or PUT method I get an error.

The error says “Invoke-RestMethod -Uri "helpdesk_URL/.../Helpdesk …

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

| Apache Tomcat/7.0.82 - Error report HTTP Status 403 - type Status reportmessage description Access

| to the specified resource has been forbidden.Apache Tomcat/7.0.82



Here's my script.



Param(
[string]$apikey = "our_api_key",
[string]$ticketNumber,
)

#Write ticket details to JSON
$json=@"
{
"statustype": {
"type": "StatusType",
"id": 4
}
}
"@

### This is where the script fails ####

#Update/Close Ticket
Invoke-RestMethod -Uri "">helpdesk_URL/.../$($ticketNumber) -Method PUT -Body $json -ContentType "application/json"