News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Downloading fax attachment
Tags: rest api
Feb 22, 2020 at 10:47pm   •   1 replies  •  0 likes
Sameer Roy

I am working on C# platform and exploring it. I am trying to use Fax api and trying to download the fax attachment content in the code. I can see I get the binary data as output as response of the API once I input the message and attachment id:

https://platform.devtest.ringcentral.com/restapi/v1.0/account/accountId/extension/extensionId/message-store/messageId/content/attachmentId


1 Answer
answered on Feb 22, 2020 at 11:38pm  

You can check the following:

RestClient rc = new RestClient("ClientID", "ClientSecret", false); 
await rc.Authorize("username", "extensionNumber", "password"); ... 
var extension = rc.Restapi().Account().Extension(); 
var messages = response.records; 
// fax var message = messages.Where(m => m.type == "Fax" && m.messageStatus != "SendingFailed" && m.attachments != null && m.attachments.Length > 0).Skip(3).First(); 
var content = await extension.MessageStore(message.id).Content(message.attachments[0].id).Get(); 
System.IO.File.WriteAllBytes("filename.ext", content.data);

ref: https://stackoverflow.com/questions/52486470/how-to-view-download-the-sent-fax-using-ringcentral-fax-api-c-sharp

full code reference: https://github.com/ringcentral/ringcentral-csharp-client/blob/master/RingCentral.Test/BinaryTest.cs



 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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us