Here is the code you asked for in this issue.
public async Task<object> Read(FaxReadType faxReadType)
{
object returnData = null;
try
{
using (RestClient rc = new RestClient(RINGCENTRAL_CLIENTID
, RINGCENTRAL_CLIENTSECRET
, IS_PRODUCTION))
{
TokenInfo tokenInfo = await rc.Authorize(RINGCENTRAL_USERNAME
, RINGCENTRAL_EXTENSION
, RINGCENTRAL_PASSWORD);
if (rc.token.access_token.Length > 0)
{
switch (faxReadType)
{
case FaxReadType.ReadContent:
ReadMessageContentParameters read = new ReadMessageContentParameters
{
contentDisposition = "Attachment"
};
returnData = await rc.Restapi().Account().Extension()
.MessageStore(messageId).Content(attachmentId).Get(read);
break;
case FaxReadType.ReadMessage:
returnData = await rc.Restapi().Account().Extension()
.MessageStore(messageId).Get();
break;
}
}
}
}
catch (Exception ex)
{
//Log exception in DB
}
return returnData;
}