Community - SOTI MobiControl

Community - SOTI MobiControl

There's a new home for Articles. Find Articles on Our Product Support Page.

SOTI MobiControl Discussions


  • 0 votes 2 answers

    Modifying a Custom Attribute on an device by API & PS Solved Locked

    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.  

    SOTI MobiControl
    4 years ago

Top 3 Contributors of The Week

View All

Earn Contributor Badge

More info
  • Diamond
    Diamond New !

    Top-tier experts who are delivering outstanding content. Should have more than 7000 points.

  • Platinum

    Experts who are consistent with great content. Should have more than 1000 points

  • Gold

    Highly experienced members with valuable inputs. Should have more than 700 points

  • Silver

    Beginners taking the initiative. Should have more than 500 points