API Call /devicegoups/{path}/.. only works on fresh devices

Solved
SH
Sepp Hanso
EMPL Fahrzeugwerk Gesellschaft m.b.H

Hi,
i played around with API function /devicegroups

I tried PUT and DELETE /devicegroups/{path}/customAttributes/{customAttributeId}

Problem is that only free or new devices are affected, devices with edited Values will not get touched.

Swagger Page on DELETE:
Clears a custom attribute value for a single device group identified by its reference ID (recommended) or path. Requires the caller be granted the "Edit Custom Attribute Values" permission for the specified device group.

Is there a way to get this work on all devices like the documentation says.

Thanks for some infos about that

 
8 months ago
SOTI MobiControl
ANSWERS
RC
Raymond Chan Diamond Contributor
8 months ago

Hi Sepp,

What you see in your API tests are expected behaviour similar to what one will see if manipulating CA  interactively with MobiControl web-console.

When the CA value of a device has been manually modified (i.e. overrode the DEFAULT value INHERITED from its parent device group or above), then even if its parent group or above have such CA value modified at the group level later, the CA value that have already been overridden at the device-level will be kept unchanged.

Solution
RS
Rafael Schäfer
8 months ago

How do you mean?

First of all, you edit it for a path, not a device directly.
What kind of issue you see here? Is the data not changed (do you get an error from the API call) or do the devices not get the (changed) data or something else?

Does it work if you change the attribute manually?

SH
Sepp Hanso
8 months ago

Hi Rafael,

when i update a CustomAttribute of an specific device over the api or webconsole i cant clear or update it afterwards by using the /devicegroups/{path}/customAttributes/{customAttributeId}, all other devices (none edited) in the given path will be updated correct.

When i use /devices/{deviceId}/customAttributes/{customAttributeId} i can update an allready edited CA without any problems.

RS
Rafael Schäfer
8 months ago

You are spotting on 2 different things here.

1.One is the API endpoint to the path inheriting it's data to all devices and paths underneath. So if you change something on device level and there's something setup on it's path, after cleaning the device CA, it will get (again) the path's CA.

2.One is the device CA. The device CA will overwrite all inherited CA but if cleaned, get them inherited again.

So, check if on affected/issuing devices, nothing is set on it's parent path inheriting to it.

SH
Sepp Hanso
8 months ago

You are right, just tested it 

When i delete the manual setted value of the CA and than run the updatescript for the "Path" the device gets affected.

Looks like i have to rewrite the script an use /devices/{deviceId}/customAttributes/{customAttributeId} in a loop for every DeviceID :(

Thank you for this information.

P
PMMOD@SOTI
8 months ago

Hello Sepp Hanso,

Thank you for your post on SOTI Pulse. Rafael Schäfer and Raymond Chan thank you for responding to the post your expertise and willingness to help are greatly appreciated!

We're glad you've been able to find a solution. Please let us know if there are any other details or links we can assist you with, and then we can close it at our end

Please let us know so we can proceed further accordingly.