News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
How does a super admin download users unread voice mail messages
Tags: voicemails
Oct 12, 2021 at 7:54pm   •   2 replies  •  0 likes
Bryan O'Reilly

Some staff are not listening to voice mail messages, as a Super Admin, can I download or listen to the messages?

When I try to, I need the User password to do so.

screenshot-2021-10-13-134950.jpg

2 Answers
answered on Oct 13, 2021 at 5:09am  

@Phong Vu Does this not require authentication and token for that extension to read their messages?


 0
on Oct 13, 2021 at 7:23am   •  0 likes

Of course you need to authenticate the app with an admin user credentials. I update the sample code with that part.

answered on Oct 12, 2021 at 9:35pm  

As a super admin, you can first read your account extensions to get a list of extension ids of those user extensions you want to access their voicemail. Then you can use the extension id to read the unread voicemail of that extension from the message store.

Here is some sample code using the RingCentral JS SDK

const RC = require('@ringcentral/sdk').SDK
var async = require('async') 

RINGCENTRAL_CLIENTID = ''
RINGCENTRAL_CLIENTSECRET = ''
RINGCENTRAL_SERVER = 'https://platform.devtest.ringcentral.com'

RINGCENTRAL_USERNAME = 'admin-user'
RINGCENTRAL_PASSWORD = 'some password'
RINGCENTRAL_EXTENSION = ''

var rcsdk = new RC({
      server: RINGCENTRAL_SERVER,
      clientId: RINGCENTRAL_CLIENTID,
      clientSecret: RINGCENTRAL_CLIENTSECRET
  });
var platform = rcsdk.platform();

platform.login({
      username: RINGCENTRAL_USERNAME,
      password: RINGCENTRAL_PASSWORD,
      extension: RINGCENTRAL_EXTENSION
      })
platform.on(platform.events.loginSuccess, function(e){
  get_extensions()
});

var extensionList = []
async function get_extensions() {
  try {
    var resp = await platform.get('/restapi/v1.0/account/~/extension', { type: "User", status: "Enabled"})
    var jsonObj = await resp.json
        for (var record of jsonObj.records){
            extensionList.push(record.id)
        }
        readExtensionMessageStore()
    }catch(e){
        console.log("Something went wrong.")
    }
}

async function readExtensionMessageStore(){
  async.eachSeries(extensionList, function (id, done) {
          setTimeout(async function () {
            var endpoint = `/restapi/v1.0/account/~/extension/${id}/message-store`
            try {
              var params = {
                         dateFrom: '2021-07-01T00:00:00.000Z',
                         dateTo: '2021-10-11T23:59:59.999Z',
                         messageType: 'VoiceMail',
                         readStatus: ['Unread']
                       }
              var resp = await platform.get(endpoint, params)
              var jsonObj = await resp.json()
              if (jsonObj.records.length){
                console.log(extensionId)
                for (var record of jsonObj.records){
                  console.log("=========== EXTENSION MESSAGE STORE ===========")
                  console.log(record)
                  console.log("+++++++++++++++++++++++++++++++++++++")
                }
              }
              done()
            }catch(ex){
              console.log(ex.message)
              done()
            }
          }, 1200);
      }, function (err)
          console.log("Read extension voicemail completed!")
      });
}

Hope this helps.


 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us