question

Sameer Roy avatar image
Sameer Roy asked ·

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


fax attachment
1 |1000 characters needed characters left characters exceeded

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

1 Answer

· Write an Answer
Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary 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


Share
1 |1000 characters needed characters left characters exceeded

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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