There's a new home for Articles. Find Articles on Our Product Support Page.
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.
Top-tier experts who are delivering outstanding content. Should have more than 7000 points.
Experts who are consistent with great content. Should have more than 1000 points
Highly experienced members with valuable inputs. Should have more than 700 points
Beginners taking the initiative. Should have more than 500 points