Fax attachments download using C#
Tags: sdk
Sep 24, 2018 at 2:16pm • 5 replies • 0 likes
zgrada-zgrada
Could you help me with RingCentral Fax API.
I need C# code to download fax attachments . I'am using sandbox account and I found this API in APi Explorer /restapi/v1.0/account/{accountId}/extension/{extensionId}/message-store/{messageId}/content/{attachmentId}
5 Answers
When I inspect the attachment:
You can see that type is RenderedDocument
The attachment is not the original file from the fax sender. And it might be the result of the merging of multiple files.
There is no name for the attachment file. We only know that it's a PDF.
{ id: 1111,
uri:
'https://media.devtest.ringcentral.com/restapi/v1.0/account/111/extension/222/message-sto...',
type: 'RenderedDocument',
contentType: 'application/pdf' }
You can see that type is RenderedDocument
The attachment is not the original file from the fax sender. And it might be the result of the merging of multiple files.
There is no name for the attachment file. We only know that it's a PDF.
0
I think all of them are of ".pdf" extension, regardless of their original format. This is because before sending the fax, RingCentral server will pre-render the content to PDF format. So the receiver side always get PDF files.
Let me double check though.
Let me double check though.
0
Hi, I have another problem. Filename is always null. I need filename with extension.
In this case filename is NULL
rc = new RestClient(RingCentralAppKey, RingCentralAppSecretKey,false);
await rc.Authorize(RingCentralUsername, RingCentralExtension, RingCentralPassword);
var account = rc.Restapi().Account();
var extension = account.Extension();
var response = await extension.MessageStore().List();
var messages = response.records;
// fax
var message = messages.Where(m => m.type == "Fax" && m.messageStatus != "SendingFailed" && m.attachments != null && m.attachments.Length > 0);
foreach (var m in message)
{
var messageResponse = await extension.MessageStore( m.id).Content(m.attachments[0].id).Get();
var content = messageResponse.data;
var file = new DocumentModel
{
FileName = m.attachments[0].filename,//this is null
FileContent = content
};
}
In this case filename is NULL
rc = new RestClient(RingCentralAppKey, RingCentralAppSecretKey,false);
await rc.Authorize(RingCentralUsername, RingCentralExtension, RingCentralPassword);
var account = rc.Restapi().Account();
var extension = account.Extension();
var response = await extension.MessageStore().List();
var messages = response.records;
// fax
var message = messages.Where(m => m.type == "Fax" && m.messageStatus != "SendingFailed" && m.attachments != null && m.attachments.Length > 0);
foreach (var m in message)
{
var messageResponse = await extension.MessageStore( m.id).Content(m.attachments[0].id).Get();
var content = messageResponse.data;
var file = new DocumentModel
{
FileName = m.attachments[0].filename,//this is null
FileContent = content
};
}
0
1
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