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
Attaching Multiple Documents for Fax
Tags: fax
May 10, 2022 at 7:51am   •   2 replies  •  0 likes
Sy Hasan

Hi folks,

I'm trying to do some automation, but wanted to know if you can attach multiple documents to one request? It allows me to attach one document and fax successfully, but not a second or multiple. For example, this is what I have when writing it in JSON:

Request URL: https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/fax
Request Body:

[
  {
    "control_type": "text",
    "label": "To",
    "name": "to",
    "type": "string",
    "optional": false
  },
  {
    "control_type": "text",
    "label": "Cover index",
    "name": "coverIndex",
    "type": "string",
    "optional": false
  },
  {
    "control_type": "text",
    "label": "Cover page text",
    "name": "coverPageText",
    "type": "string",
    "optional": false
  },
  {
    "name": "attachments",
    "type": "array",
    "optional": false,
    "binary_content": "false",
    "properties": []
  }
]
2 Answers
answered on May 10, 2022 at 9:39am  

Yes, you can send multiple attachments. Just make sure the total of all attachments size must not exceed the max size of 50MB. See this code sample using the RingCentral JS SDK.

async function send_fax() {
  try{
    var endpoint = "/restapi/v1.0/account/~/extension/~/fax"
    var FormData = require('form-data');
    formData = new FormData();
    var body = {
      to: [{'phoneNumber': "RECIPIENT_NUMBER", 'name': "Recipient name" }],
      faxResolution: "High"
      coverPageText: "This is a demo Fax page from Node JS\n \
Recipient company\n \
Sender name\n \
Fax number\n \
Subject is subject\n \
Comments/Notes"
    }

    formData.append('json', new Buffer.from(JSON.stringify(body)), {
        filename: 'text.json',
        contentType: 'application/json'
        });

    formData.append('attachment', require('fs').createReadStream('first_file.jpg'));
    formData.append('attachment', require('fs').createReadStream('second_file.png'));

    var resp = await platform.post(endpoint, formData)
    var jsonObj = await resp.json()
    console.log("FAX sent. Current status: " + jsonObj.messageStatus + "/" + jsonObj.id)
  }catch(e){
    console.log(e.messsage)
  }
}


See the dev guide documentation for more details


 0
on May 13, 2022 at 8:05am   •  0 likes
Thanks Phong. However, how would I convert it to the format above? I am using Workato, which is similar to Postman to write this out. Unfortunately, I cannot use any other language format aside from JSON as I posted above. Thanks!
on May 13, 2022 at 8:22am   •  0 likes

I am not a Workato expert. You can either ask Workato support or check this out since you said that it is similar to Postman.

on May 13, 2022 at 9:53am   •  0 likes

Cool, thanks for that.

answered on May 10, 2022 at 9:34am  

Hi @Sy Hasan
From what I know and what I have tested, you have an option of attaching multiple files/documents to fax but they will get converted to a single pdf file (with multiple pages) and will be sent to the recipient.

What that means is that the recipient will have a single document with multiple pages in it which can represent different documents attached from the source.

Could you share more details about your use case and am I understanding it correctly that you want the recipient to receive multiple documents instead of a single file with multiple pages?


 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