question

Gordon Lampshire avatar image
Gordon Lampshire asked Phong Vu answered

Is there an API function to clear or reset a voice mailbox?

I can change a users details like name, email address, role and also the delete the call log via the API but how can I also automatically clear any saved or unheard messages before a new user takes over a number please?

rest apivoicemail
1 |3000

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

1 Answer

Phong Vu avatar image
Phong Vu answered

Yes, you can call the Get Message List API to read all messages (set messageType=VoiceMail if you only want to read voicemail messages) of an extension. Then grab all the message ids and call the Delete Message API to delete them. The delete message takes an array of message ids so you can delete them all in 1 API call. Remember to set the purge=true to delete all attachments associated with those messages. Here is an example in Node JS to delete a single message and its associated attachments:

async function deleteMessage(id){
  await platform.delete(`/restapi/v1.0/account/~/extension/~/message-store/${id}?purge=true`)
}
1 |3000

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