Change device name with REST API

A
Andy
Galliker Transport AG

Is there a way to change the device name with the REST API? I am using the API already to move devices to different folders and change the user of a device. But I couldn't find out if it is possible to change the name nor other attributes except of custom attributes.

Thanks for you help!

Cheers,
Andy

7 years ago
SOTI MobiControl
ANSWERS
RC
Raymond Chan Diamond Contributor
7 years ago

In principle, you can use  POST  /devices/{deviceId}/actions 

to perform "SendScript" action, and include a "devrename" command in your script.

A
Andy
7 years ago

Thanks for the response.

So, that means there is no direct way to change any device attributes?

I need to change the device name (actual name on the phone) and also the display name in SOTI web UI. Are both changes possible with a script? 

How should I send the script with the POST method? Acording to the API documentation there is only one attribute in the JSON body:

{
"Action": "SendScript"
}

TB
TJ Bukoski
7 years ago

So, that means there is no direct way to change any device attributes?

Depends on the attribute. There is an open feature request ticket at SOTI to have MobiControl change the "Personalized Device Name" on the device. So, we can't do this yet.

The MobiControl Device Name does not have it's own API for renaming the device. But there is a script command we can send to the device to rename it, so the Actions api with the SendScript parameter is the correct solution here. Besides the "SendScript" you will also need the "Message" parameter in your JSON.

{
"Action": "SendScript"
"Message": "devrename newname"
}

We also have APIs for altering Customer attributes, so you can assign server side labels to devices if you wish.

For everything else you need, please file a feature request with the support team. I think a device rename API may be a nice add.

A
Andy
7 years ago

Thanks TJ,

That's a pitty we cannot change the "Personalized Device Name". I will get in touch with the support team. 

btw - there is a comma missing in your JSON  ;-)

{
"Action": "SendScript",
"Message": "devrename newname"
}