First I am unable to get even my own personal voicemail transcriptions using this method. It find the transcription record but I can't see any parameters with the transcription string.
Second how will I change this to access a Group's voicemail transcription?
Thanks.
using System;
using System.Threading.Tasks;
using RingCentral;
namespace Account
{
class Account
{
static String SERVER_URL = "https://platform.ringcentral.com";
static String CLIENT_ID = "************";
static String CLIENT_SECRET = "********";
static String JWT_TOKEN = "************";
static RestClient restClient;
static void Main(string[] args)
{
restClient = new RestClient(CLIENT_ID, CLIENT_SECRET, true, "VoiceMailTranscriptionGet");
restClient.Authorize(JWT_TOKEN).Wait();
GetMessage().Wait();
}
static private async Task GetMessage()
{
ListMessagesParameters parameters = new ListMessagesParameters();
parameters.messageType = new String[] { "VoiceMail" };
var response = await restClient.Restapi().Account().Extension().MessageStore().List(parameters);
foreach (GetMessageInfoResponse record in response.records)
{
if (record.attachments != null)
{
foreach (var attachment in record.attachments)
{
var fileName = "./src/test/resources/" + record.attachments[0].id + "_voicemail.txt";
if (attachment.type == "AudioTranscription")
{
var res = restClient.Restapi().Account().Extension().MessageStore(record.id.ToString()).Content(attachment.id.ToString()).Get();
//Path path = Paths.get(fileName);
//Files.write(path, res);
}
}
}
}
}
}
}