Could someone provide an example of an XML payload for PUT /computers/id/{id} ?

New Contributor III

What is the proper format to the xml payload sent to /JSSResource/computers/id/{id}? Do I send only <extension_attribute>? Do I send the entire XML set with just the changes needed?

Here is a representation of a curl call that I'm trying (from Postman):

curl -X PUT 
  -H 'Authorization: Basic dGVAFAVADdaVAVaZXM=' 
  -H 'Cache-Control: no-cache' 
  -H 'Content-Type: text/xml' 
  -d '  <extension_attributes>
      <value>OUT STRING</value>

Which produces this:

<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Bad Request</p> <p>Error in XML file</p>

Many thanks!


New Contributor III

Still no luck but, after referencing this

Which now shows...

<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Conflict</p> <p>Error: Not authorized for a user PUT</p>

Valued Contributor

You are trying to update the text in an extension attribute for a device?

New Contributor III

I'm trying up updated (or add) to extension_attribute in a collections of managed Mac.

And it turns out with a bit more digging, I was able to make some headway.

Assuming the following as a payload, I am able to inject data.

<?xml version="1.0" encoding="UTF-8" standalone="no"?><computer><extension_attributes> <attribute> <name>AD-OU</name> <value>I CAN PUT THE OUT HERE</value> </attribute></extension_attributes></computer>