Hello - is there a method to assign an unassigned extension to a user via the API? I tried 2 methods and neither worked so I am curious if I am doing something wrong or if there just isn't a way to do this yet.
I first tried using 'Update Device': https://platform.devtest.ringcentral.com/restapi/v1.0/account/accountId/device/deviceId
I used a deviceId of an unassigned extension and passed in the extension id of an existing user. This method resulted in the following error: "Unknown device update use case".
I then tried using 'Update Extension': https://platform.devtest.ringcentral.com/restapi/v1.0/account/accountId/extension/extensionId
I used the extensionId of an unassigned extension, and passed in the user contact information (the user did not exist in RC). The API request went through, but when I went to look in RC, the extension was still in the 'Unassigned Extensions' section and when I clicked on the link, it brought up a read-only page showing the contact info I added to the extension but nothing could be updated. I had to assign the extension to someone else manually to get the extension out of the 'Unassigned' list.
Any help/thoughts would be appreciated - thank you!
Unassigned Extensions
Here is how you can assign an unassigned extension. I assumed that you can read and use Node JS and RingCentral JS SDK. But if not, let me know.
function find_unassigned_extensions(){ platform.get('/account/~/extension') .then(function (resp) { var jsonObj = resp.json() for (var record of jsonObj.records){ if (record.type == "User" && record.status == "Unassigned"){ //console.log(JSON.stringify(record)) //console.log("======") if (record.id == "260981XXX"){ // The extension you want to assi assign_this_extension_to_a_new_user(record.id) } } } }) .catch(function(e){ console.log(e.message) }); } function assign_this_extension_to_a_new_user(extId){ var params = { status: "Enabled", extensionNumber: 202, // leave this or make sure the number are not being used contact: { firstName: "Demo", lastName: "Automated", company: "Test", jobTitle: "consultant", email: "valid.email@address.com", emailAsLoginName: true }, password: "some-password" } platform.put('/account/~/extension/' + extId, params) .then(function (resp) { var jsonObj = resp.json() console.log(jsonObj) }) .catch(function(e){ console.log(e.message) }); }
Appreciate the response Phong! Node is just fine - that is the same function call I used but our params don't quite match up, so I will try it again and report back.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.