500 error with Samanage API Powershell

Hi,

I was playing around with the API, but i cant figure out how to make it work.

I successfuly authenticated and i can make GET requests to gather an incident for example.

But when i want to update or create an incident (using PUT or POST), i constantly have a 500 error.

$URI = "https://apieu.samanage.com/incidents/10498330"
$Body = @"

{
    "incident" : {
        "name": "bonjour",
        "description": "ceci est un test",
        "category": {
            "name": "Bureautique"
        },
        "requester": {
            "email": "xxxxxxxxxxx"
        },
    }
   
}

"@
$Body
$Request2 = Invoke-WebRequest -URI $URI -Method PUT -Body $Body -Headers $Headers  
$Request2

The body is correctly formated to json.

Thanks for your help!

Parents Reply Children
No Data