faxringcentral

Sending Fax by RingCentral API


I was trying to use fax API of RingCentral on Sandbox URL using REST client:

https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/fax with following:

Authorization: Bearer {{my access_token}}"
Content-Type: application/json

{
    "to": [{
        "phoneNumber": "<my phone number>"
    }],
    "faxResolution": "High",
    "sendTime": "2019-02-20T09:30:10.800Z"
}

But getting Bad Request issue from the fax API:

status code=400 content type=application/json;
{
    "message": "Bad Request",
    "errors": []
}

Solution

  • The issue clearly shows the contentType or fax MIME body...
    Since the fax api support attachments as data. 400 Bad request error is caused due to wrong content or mime type

    Content-Type: multipart/mixed
    

    The API allows sending a fax message with a multipart request, incorporating two or more parts.

    ref: https://developers.ringcentral.com/api-reference#

    Following reference has described the same:

    https://forums.developers.ringcentral.com/questions/517/weird-boundary-in-presence-response-when-requestin.html

    https://forums.developers.ringcentral.com/questions/614/switching-to-f-form-option-for-posting-multipartmi.html?page=2&pageSize=10&sort=oldest