question

Ajay Wadhawan avatar image
Ajay Wadhawan asked Ajay Wadhawan published

update "@rc-ex/core": "^0.9.3" @rc-ex/core": "^0.15.0 not working

types library is missing

" @rc-ex/core/lib/definitions. Our code takes advantages of the types and is no longer compiling".
import { Attachment ,
CreateFaxMessageRequest ,
CreateSubscriptionRequest ,
FaxResponse ,
SubscriptionInfo ,
RecordsCollectionResourceSubscriptionResponse ,
NotificationDeliveryModeRequest ,
ModifySubscriptionRequest } from " @rc-ex/core/lib/definitions ";


rest apisdk
2 comments
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

What is the background? What did you do and expect? No one would understand and help you with such a vague question.

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ commented ·

You posted too much redundant trace and the system blocks your messy message. Clean it up and repost.

0 Likes 0 ·

1 Answer

Ajay Wadhawan avatar image
Ajay Wadhawan answered Ajay Wadhawan published

Fixed the intial problem- the defs are now seperate.Eg

import CreateFaxMessageRequest from " @rc-ex/core/lib/definitions/CreateFaxMessageRequest "; import CreateSubscriptionRequest from " @rc-ex/core/lib/definitions/CreateSubscriptionRequest "; import ModifySubscriptionRequest from " @rc-ex/core/lib/definitions/ModifySubscriptionRequest ";

But now the sendFax call is not working getting a 403 status.

code is:

async function sendFax ( rc : RingCentral , coverLetterRequest : CoverLetterRequest , dateConfig , claimsId : string , cvAttachment : Attachment ): Promise < FaxResponse > { 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 ) ;
return faxResponse ; }

errors:

Request:

[2022-12-12T22:58:53.224Z] {

[2022-12-12T22:58:53.224Z] "method": "post",

[2022-12-12T22:58:53.224Z] "baseURL": "https://platform.devtest.ringcentral.com",

[2022-12-12T22:58:53.224Z] "url": "/restapi/v1.0/account/~/extension/~/fax",

[2022-12-12T22:58:53.224Z] "data": "{\"filename\":\"request.json\",\"contentType\":\"application/json\",\"content\":\"{\\\"to\\\":[{\\\"phoneNumber\\\":\\\"3233062146\\\"}],\\\"faxResolution\\\":\\\"High\\\",\\\"coverPageText\\\":\\\"CoverPage Attached\\\",\\\"coverIndex\\\":0}\"}\n{\"filename\":\"/var/folders/0b/bgjn5t6940g5pc6jj5dvkfs40000gn/T/cover3c416499-585f-43ef-b402-beaca490d6e0.pdf\",\"contentType\":\"application/pdf\",\"content\":\"<binary data>\"}",

[2022-12-12T22:58:53.224Z] "headers": {

[2022-12-12T22:58:53.224Z] "Accept": "application/json, text/plain, */*",

[2022-12-12T22:58:53.224Z] "Content-Type": "multipart/form-data; boundary=--------------------------307200111318946977987110",

[2022-12-12T22:58:53.224Z] "X-User-Agent": "Unknown/0.0.1 ringcentral-extensible/core/0.12",

[2022-12-12T22:58:53.224Z] "Authorization": "Bearer U0pDMTJQMDFQQVMwMHxBQUN1VTlXSlJwcHhlUzZUb2FWcDZPZUEyVVduSV9CZ19XWlB4blFwbWtkQWtIR2lhZkxIXzZ5R2NJaEpzRWhHejBTRHJCRFZ6SEFOM3kxamtLajZ4UUFpMDhjSVpFZ1h2czFkX0d0ckFCLWNYR2h5bEtTOUFXY25GUHFVamcxMFBweFFySkRaNGRseHJSUElVRFFuVEZPZWZWdHJqbjdVd3ZKdFVyQWNzWkFKN05PTzg1dWV4bnFCaUloMmNJbmtGeFBpSTdIeF9tZ3xnZ2xtamd8N3BaR3ZZbU85UmVrSlg3M2FHVkVGd3xBUXxBQXxBQUFBQUljVVVuUQ",

[2022-12-12T22:58:53.224Z] "User-Agent": "axios/0.27.2",

[2022-12-12T22:58:53.224Z] "content-type": "multipart/form-data; boundary=--------------------------307200111318946977987110"

[2022-12-12T22:58:53.224Z] }

[2022-12-12T22:58:53.224Z] }


Response:

Stack: Error: HTTP 403 Forbidden

[2022-12-12T22:58:53.223Z]

[2022-12-12T22:58:53.223Z] Response:

[2022-12-12T22:58:53.223Z] {

[2022-12-12T22:58:53.223Z] "data": "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 7]> <html class=\"no-js ie7 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 8]> <html class=\"no-js ie8 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en-US\"> <!--<![endif]-->\n<head>\n<title>Attention Required! | Cloudflare</title>\n<meta charset=\"UTF-8\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\" />\n<meta name=\"robots\" content=\"noindex, nofollow\" />\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n<link rel=\"stylesheet\" id=\"cf_styles-css\" href=\"/cdn-cgi/styles/cf.errors.css\" />\n<!--[if lt IE 9]><link rel=\"stylesheet\" id='cf_styles-ie-css' href=\"/cdn-cgi/styles/cf.errors.ie.css\" /><![endif]-->\n<style>body{margin:0;padding:0}</style>\n\n\n<!--[if gte IE 10]><!-->\n<script>\n if (!navigator.cookieEnabled) {\n window.addEventListener('DOMContentLoaded', function () {\n var cookieEl = document.getElementById('cookie-alert');\n cookieEl.style.display = 'block';\n })\n }\n</script>\n<!--<![endif]-->\n\n\n</head>\n<body>\n <div id=\"cf-wrapper\">\n <div class=\"cf-alert cf-alert-error cf-cookie-error\" id=\"cookie-alert\" data-translate=\"enable_cookies\">Please enable cookies.</div>\n <div id=\"cf-error-details\" class=\"cf-error-details-wrapper\">\n <div class=\"cf-wrapper cf-header cf-error-overview\">\n <h1 data-translate=\"block_headline\">Sorry, you have been blocked</h1>\n <h2 class=\"cf-subheadline\"><span data-translate=\"unable_to_access\">You are unable to access</span> platform.devtest.ringcentral.com</h2>\n </div><!-- /.header -->\n\n <div class=\"cf-section cf-highlight\">\n <div class=\"cf-wrapper\">\n <div class=\"cf-screenshot-container cf-screenshot-full\">\n \n <span class=\"cf-no-screenshot error\"></span>\n \n </div>\n </div>\n </div><!-- /.captcha-container -->\n\n <div class=\"cf-section cf-wrapper\">\n <div class=\"cf-columns two\">\n <div class=\"cf-column\">\n <h2 data-translate=\"blocked_why_headline\">Why have I been blocked?</h2>\n\n <p data-translate=\"blocked_why_detail\">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.</p>\n </div>\n\n <div class=\"cf-column\">\n <h2 data-translate=\"blocked_resolve_headline\">What can I do to resolve this?</h2>\n\n <p data-translate=\"blocked_resolve_detail\">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 found at the bottom of this page.</p>\n </div>\n </div>\n </div><!-- /.section -->\n\n <div class=\"cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300\">\n <p class=\"text-13\">\n <span class=\"cf-footer-item sm:block sm:mb-1\">Cloudflare Ray ID: <strong class=\"font-semibold\">778a1138da42e909</strong></span>\n <span class=\"cf-footer-separator sm:hidden\">&bull;</span>\n <span id=\"cf-footer-item-ip\" class=\"cf-footer-item hidden sm:block sm:mb-1\">\n Your IP:\n <button type=\"button\" id=\"cf-footer-ip-reveal\" class=\"cf-footer-ip-reveal-btn\">Click to reveal</button>\n <span class=\"hidden\" id=\"cf-footer-ip\">71.78.207.51</span>\n <span class=\"cf-footer-separator sm:hidden\">&bull;</span>\n </span>\n <span class=\"cf-footer-item sm:block sm:mb-1\"><span>Performance &amp; security by</span> <a rel=\"noopener noreferrer\" href=\"https://www.cloudflare.com/5xx-error-landing\" id=\"brand_link\" target=\"_blank\">Cloudflare</a></span>\n \n </p>\n <script>(function(){function d(){var b=a.getElementById(\"cf-footer-item-ip\"),c=a.getElementById(\"cf-footer-ip-reveal\");b&&\"classList\"in b&&(b.classList.remove(\"hidden\"),c.addEventListener(\"click\",function(){c.classList.add(\"hidden\");a.getElementById(\"cf-footer-ip\").classList.remove(\"hidden\")}))}var a=document;document.addEventListener&&a.addEventListener(\"DOMContentLoaded\",d)})();</script>\n</div><!-- /.error-footer -->\n\n\n </div><!-- /#cf-error-details -->\n </div><!-- /#cf-wrapper -->\n\n <script>\n window._cf_translation = {};\n \n \n</script>\n\n</body>\n</html>\n",

[2022-12-12T22:58:53.224Z] "status": 403,

[2022-12-12T22:58:53.224Z] "statusText": "Forbidden",

[2022-12-12T22:58:53.224Z] "headers": {

[2022-12-12T22:58:53.224Z] "date": "Mon, 12 Dec 2022 22:58:53 GMT",

[2022-12-12T22:58:53.224Z] "content-type": "text/html; charset=UTF-8",

[2022-12-12T22:58:53.224Z] "transfer-encoding": "chunked",

[2022-12-12T22:58:53.224Z] "connection": "close",

[2022-12-12T22:58:53.224Z] "cache-control": "max-age=15",

[2022-12-12T22:58:53.224Z] "expires": "Mon, 12 Dec 2022 22:59:08 GMT",

[2022-12-12T22:58:53.224Z] "x-frame-options": "SAMEORIGIN",

[2022-12-12T22:58:53.224Z] "server": "cloudflare",

[2022-12-12T22:58:53.224Z] "cf-ray": "778a1138da42e909-DFW"

[2022-12-12T22:58:53.224Z] }

[2022-12-12T22:58:53.224Z] }

[2022-12-12T22:58:53.224Z]

[2022-12-12T22:58:53.224Z] Request:

[2022-12-12T22:58:53.224Z] {

[2022-12-12T22:58:53.224Z] "method": "post",

[2022-12-12T22:58:53.224Z] "baseURL": "https://platform.devtest.ringcentral.com",

[2022-12-12T22:58:53.224Z] "url": "/restapi/v1.0/account/~/extension/~/fax",

[2022-12-12T22:58:53.224Z] "data": "{\"filename\":\"request.json\",\"contentType\":\"application/json\",\"content\":\"{\\\"to\\\":[{\\\"phoneNumber\\\":\\\"3233062146\\\"}],\\\"faxResolution\\\":\\\"High\\\",\\\"coverPageText\\\":\\\"CoverPage Attached\\\",\\\"coverIndex\\\":0}\"}\n{\"filename\":\"/var/folders/0b/bgjn5t6940g5pc6jj5dvkfs40000gn/T/cover3c416499-585f-43ef-b402-beaca490d6e0.pdf\",\"contentType\":\"application/pdf\",\"content\":\"<binary data>\"}",

[2022-12-12T22:58:53.224Z] "headers": {

[2022-12-12T22:58:53.224Z] "Accept": "application/json, text/plain, */*",

[2022-12-12T22:58:53.224Z] "Content-Type": "multipart/form-data; boundary=--------------------------307200111318946977987110",

[2022-12-12T22:58:53.224Z] "X-User-Agent": "Unknown/0.0.1 ringcentral-extensible/core/0.12",

[2022-12-12T22:58:53.224Z] "Authorization": "Bearer U0pDMTJQMDFQQVMwMHxBQUN1VTlXSlJwcHhlUzZUb2FWcDZPZUEyVVduSV9CZ19XWlB4blFwbWtkQWtIR2lhZkxIXzZ5R2NJaEpzRWhHejBTRHJCRFZ6SEFOM3kxamtLajZ4UUFpMDhjSVpFZ1h2czFkX0d0ckFCLWNYR2h5bEtTOUFXY25GUHFVamcxMFBweFFySkRaNGRseHJSUElVRFFuVEZPZWZWdHJqbjdVd3ZKdFVyQWNzWkFKN05PTzg1dWV4bnFCaUloMmNJbmtGeFBpSTdIeF9tZ3xnZ2xtamd8N3BaR3ZZbU85UmVrSlg3M2FHVkVGd3xBUXxBQXxBQUFBQUljVVVuUQ",

[2022-12-12T22:58:53.224Z] "User-Agent": "axios/0.27.2",

[2022-12-12T22:58:53.224Z] "content-type": "multipart/form-data; boundary=--------------------------307200111318946977987110"

[2022-12-12T22:58:53.224Z] }

[2022-12-12T22:58:53.224Z] }

[2022-12-12T22:58:53.224Z]

[2022-12-12T22:58:53.224Z] at Rest.request (/Users/ajaywadhawan/dev/coach-infrastructure/AzureFunctions/node_modules/@rc-ex/core/lib/Rest.js:71:15)

[2022-12-12T22:58:53.224Z] at processTicksAndRejections (internal/process/task_queues.js:93:5)

[2022-12-12T22:58:53.224Z] at async RingCentral.request (/Users/ajaywadhawan/dev/coach-infrastructure/AzureFunctions/node_modules/@rc-ex/core/lib/index.js:27:23)

[2022-12-12T22:58:53.224Z] 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).

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