Skip to main content
Question

Retrieve Voicemail Transcription using Python SDK

  • November 30, 2025
  • 2 replies
  • 56 views

Is it possible to retrieve voicemail transcription using python sdk?

I am getting the following response from the message when calling the message-store API

/restapi/v1.0/account/~/extension/{extension_id}/message-store'

Then using the uri in the message, which I am hoping is the ascii transcription but unsure how to get it from the api response. 

What would be the correct way to retrieve the transcription from a voicemail using python SDK?

 

2 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • November 30, 2025

 I assume that you have installed the RingCentral Python SDK and know how to authenticate your app.

Here is the sample Python code. It also allows you to save the audio file.

P.S something is wrong that I cannot post the code here!


PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • November 30, 2025
def read_voicemail_content():
resp = platform.get('/restapi/v1.0/account/~/extension/~/message-store',
{
'dateFrom': '2025-11-01T00:00:00.000Z',
'dateTo': '2025-11-10T23:59:59.999Z',
'messageType': 'VoiceMail'
})
path = os.getcwd() + "/voicemail_content/"
try:
os.mkdir(path)
except OSError:
print ("Creation of the directory %s failed" % path)
for record in resp.json().records:
if record.attachments != None:
for attachment in record.attachments:
fileName = ("%s_voicemail" % str(record.attachments[0].id))
if attachment.type == "AudioRecording":
if attachment.contentType == "audio/mpeg":
fileName = ("%s.mp3" % fileName)
else:
fileName = ("%s.wav" % fileName)
elif attachment.type == "AudioTranscription" and record.vmTranscriptionStatus == "Completed":
fileName = ("%s.txt" % fileName)
try:
res = platform.get(attachment.uri)
file = open(("%s%s" % (path, fileName)),'w')
file.write(res.body())
file.close()
except ApiException as e:
print (e.getMessage())