Skip to main content
Solved

API Update/Replace Extension/User: How to remove values?

  • September 14, 2020
  • 2 replies
  • 467 views

I could not figure out a way to remove values from extensions contact information using the API.

Both Update Extension and Update/Replace User seem to not offer the functionality to remove values, e.g. the mobile phone number.

This is a common use case in our company, people having a mobile number migration to VOIP and therefore loose the mobile number. In such a case an automated process should remove the mobile number from the contact information.

I tried sending empty value (with " and without), sending null.

While everthing that is not a valid number returns a validation error, sending null (which I would have expected to be the right way as specified in JSON) does not send an error, but does not have an effect at all.

So how can I remove contact information using the API call?

Best answer by PhongVu

Just make a PUT call to this endpoint with the "mobilePhone":"".

See the example code below

// Use the RingCentral JS SDK
var p = { contact: { mobilePhone: ""}})
try{
  var r = await platform.put('/restapi/v1.0/account/~/extension/[extensionId]', p)
  var jsonObj = await r.json()
  console.log(JSON.stringify(jsonObj
}catch(e){
    console.log(e.message)
}


View original
Did this thread help you find an answer to your question?

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • September 14, 2020

Just make a PUT call to this endpoint with the "mobilePhone":"".

See the example code below

// Use the RingCentral JS SDK
var p = { contact: { mobilePhone: ""}})
try{
  var r = await platform.put('/restapi/v1.0/account/~/extension/[extensionId]', p)
  var jsonObj = await r.json()
  console.log(JSON.stringify(jsonObj
}catch(e){
    console.log(e.message)
}



Indeed, that worked. I had the impression I have tested everything without any positive result, looks like I have overseen the simplest option. Thanks!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings