I am trying to make an API call to update one device in using the reference ID. I am able to fetch token but having issue when using PUT to update the device. Here is what i tried so far:
### Call API
#Module and Configurations API
Import-Module -Name "F:\SOTI_API\Mod-MobiControl.psm1"
Set-TrustAllCertsPolicy$Token = Get-MCToken
$MCFQDN = Get-MCFQDN#Core script
$headers = @{}
$headers["Authorization"] = "Bearer " + $Token
$deviceId = "9c5c8e786faa050100171845214D2417"
$AttributeValue = @{}
$AttributeValue["customAttributeValue"] = "123"
$body = $AttributeValue | ConvertTo-Json
#PUT customAttributes Projet$result = Invoke-restmethod -Uri "https://$MCFQDN/mobicontrol/api/devices/$deviceId/customAttributes/Projet" -ContentType "application/json" -Method PUT -Headers $headers -body $body
When trying to execute the above, getting below error:
Invoke-restmethod : { "$type": "ErrorDetails", "ErrorCode": 0, "Message": "Échec de validation du contrat", "Data": [ "customAttributeValue: Error parsing value" ], "HelpLink": null }
Au caractère Ligne:22 : 15
+ $result = Invoke-restmethod -Uri "https://$MCFQDN/mobicontrol/api/devices/$d ...
Any help is greatly appreciated.

