Skip to main content
Question

updated to 0.15.0 ringcentral-extensible SendFax now failing

  • December 29, 2022
  • 7 replies
  • 360 views

environment: sandbox, have not tried in prod environment

code:

const cvAttachment: Attachment = {filename: fName,
content: fs.createReadStream(fName), contentType: "application/pdf"};
let faxRequest: CreateFaxMessageRequest =
{ to: [{ phoneNumber: coverLetterRequest.toFax }],faxResolution: "High",
coverPageText: "CoverPage Attached", coverIndex: 0,
attachments: [cvAttachment]};
const faxResponse: FaxResponse = await rc.restapi().account()
.extension().fax().post(faxRequest);


error:

Executed 'Functions.Fax340b' (Failed, Id=80b76844-bcf2-4665-a39b-dd5fda1b85c9, Duration=17604ms)
System.Private.CoreLib: Exception while executing function: Functions.Fax340b. System.Private.CoreLib: Result: Failure
Exception: source.on is not a function
Stack: TypeError: source.on is not a function
at DelayedStream.create (/Users/ajaywadhawan/dev/coach-infrastructure/AzureFunctions/node_modules/delayed-stream/lib/delayed_stream.js:33:10)
at CombinedStream.append (/Users/ajaywadhawan/dev/coach-infrastructure/AzureFunctions/node_modules/combined-stream/lib/combined_stream.js:45:37)
at FormData.append (/Users/ajaywadhawan/dev/coach-infrastructure/AzureFunctions/node_modules/form-data/lib/form_data.js:75:3)

7 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • December 29, 2022

What is that RingCentral extensible and where do you get it from?


  • Author
  • Participating Frequently
  • January 17, 2023

Thanks @Phong Vu for your response. We have been using https://github.com/ringcentral/ringcentral-extensible for the last year or more I was told RC support had suggested we use it. It seems it is buggy. What do you suggest?


PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • January 17, 2023

@Tyler Liu Can you check this? Thanks


I believe this is a breaking change of node.js. If you downgrade node.js to version 16 or lower, the issue will disappear.

Or you upgrade to @rc-ex/core 1.0.1.alpha.0, which has fixed this issue. We cannot make change to 0.15.0 any more because it is an already published version.


  • Author
  • Participating Frequently
  • January 19, 2023

Tried using the 1.0.1-alpha.0 library.

Now I am getting an error " HTTP 403 Forbidden" in the POST call now. See below(could not attach as file on my mac)

Text of Error Page:

"Sorry, you have been blocked.You are unable to access platform.devtest.ringcentral.com. Why have I been blocked?This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.What can I do to resolve this?You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID = f78b9eb813bffe873"


ERROR Response:

"status": 403,

"statusText": "Forbidden",

"headers": {

"date": "Wed, 18 Jan 2023 20:00:59 GMT",

"content-type": "text/html; charset=UTF-8",

"transfer-encoding": "chunked",

"connection": "close",

"cache-control": "max-age=15",

"expires": "Wed, 18 Jan 2023 20:01:14 GMT",

"x-frame-options": "SAMEORIGIN",

"vary": "Accept-Encoding",

"server": "cloudflare",

"cf-ray": "78b9eb813bffe873-DFW"

}


Request:

{

"method": "post",

"baseURL": "https://platform.devtest.ringcentral.com",

"url": "/restapi/v1.0/account/~/extension/~/fax",

"data": "<Buffer>",

"headers": {

"Accept": "application/json, text/plain, */*",

"Content-Type": "multipart/form-data; boundary=ad05fc42-a66d-4a94-b807-f1c91136c17b",

"X-User-Agent": "Unknown/0.0.1 ringcentral-extensible/core/1.0.0-alpha",

}
}

STACK line of error :

Stack: Error: HTTP 403 Forbidden

at Rest.request (/Users/ajaywadhawan/dev/coach-infrastructure/AzureFunctions/node_modules/@rc-ex/core/lib/Rest.js:73:15)

at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

at async RingCentral.request (/Users/ajaywadhawan/dev/coach-infrastructure/AzureFunctions/node_modules/@rc-ex/core/lib/index.js:27:23)

at async Index.post (/Users/ajaywadhawan/dev/coach-infrastructure/AzureFunctions/node_modules/@rc-ex/core/lib/paths/Restapi/Account/Extension/Fax/index.js:25:19).

Executed HTTP request: {

requestId: "389610d8-7ba7-47e3-86f4-b9dd30454cce",

identities: "",

status: "500",

duration: "9003"

}



PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • January 19, 2023

Clean up your post or I have to delete it. It's so messy so how do you expect someone to read and help you with that?


I believe this is our sandbox environment cloudflare configuration blocked your request. You may ignore it and test it in production environment.