question

Sameer Roy avatar image
Sameer Roy asked Anirban answered

Downloading fax attachment

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


rest api
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Anirban avatar image
Anirban answered

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


1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys