TV API - "Unable to translate bytes"

Options

Hey,

I've a json with names of people in it and i'm trying to rename their computer to add their name on it.

My request looks like that :

$ReqURI = 'https://webapi.teamviewer.com/api/v1/managed/devices/' + $($Resource.id)

$Jsonbody = @{

                'name' = $name

} | ConvertTo-Json

Invoke-RestMethod -Uri $ReqURI -Body $Jsonbody -ContentType 'application/json' -Method PUT -Headers @{authorization = "Bearer $tvAccessToken" }

It works great until a "é à ü è ö" comes in, giving me the "Unable to translate bytes [E9] at index 36 from specified code page to Unicode." error.


I tried to switch "application/json" to "application/json; charset=utf-8" or utf-16 but teamviewer doesn't seem to accept that.


Any idea ?

Have a nice day