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.
2 Answers
@Phong Vu Does this not require authentication and token for that extension to read their messages?
0
Phong Vu 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.
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