Posted on 09-17-2018 09:11 AM
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
'https://Your.Server.Name:8443/JSSResource/computers/id/4?id=4'
-H 'Authorization: Basic dGVAFAVADdaVAVaZXM='
-H 'Cache-Control: no-cache'
-H 'Content-Type: text/xml'
-d ' <extension_attributes>
<extension_attribute>
<id>2</id>
<name>OU</name>
<type>String</type>
<value>OUT STRING</value>
</extension_attribute>
</extension_attributes>
'
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!
Posted on 09-17-2018 11:37 AM
Still no luck but, after referencing this https://www.jamf.com/jamf-nation/discussions/5476/api-put-extension-attributes.
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>
Posted on 09-17-2018 11:47 AM
You are trying to update the text in an extension attribute for a device?
Posted on 09-17-2018 12:52 PM
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>