question

Gary Weissenbacher avatar image
Gary Weissenbacher asked ·

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

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?

apijson
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered ·

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)
}


1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Gary Weissenbacher avatar image
Gary Weissenbacher answered ·

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

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys