question

Ajay Wadhawan avatar image
Ajay Wadhawan asked Phong Vu answered

subscription to inbound faxes failing...

We are doing a login :

platform . login ( { username : process . env . RINGCENTRAL_USERNAME , password : process . env . RINGCENTRAL_PASSWORD , extension : process . env . RINGCENTRAL_EXTENSION , } ) ;

following the succesful Login trying to subscribe for notification using the same account and extension.

var params = { //eventFilters: ['/restapi/v1.0/account/~/extension/~/message-store/instant?type=FAX'], eventFilters: [`/restapi/v1.0/account/${ process.env.RINGCENTRAL_USERNAME}/extension/${ process.env.RINGCENTRAL_EXTENSION}/fax?direction=Inbound`], deliveryMode: { transportType: "WebHook", address: process.env.DELIVERY_ADDRESS } } try { console.log("Param: ", params) var resp = await platform.post('/restapi/v1.0/subscription', params)

We are getting the error below:


Not allowed subscribe for events to extensions of other account

[2021-10-26T21:41:28.054Z] (node:30166) UnhandledPromiseRejectionWarning: Error: Not allowed subscribe for events to extensions of other account

at Client.<anonymous> (/Users/ajaywadhawan/dev/ch/coach-infrastructure/node_modules/@ringcentral/sdk/lib/http/Client.js:115:35)

[2021-10-26T21:41:28.054Z] at step (/Users/ajaywadhawan/dev/ch/coach-infrastructure/node_modules/@ringcentral/sdk/lib/http/Client.js:56:23)

[2021-10-26T21:41:28.055Z] at Object.next (/Users/ajaywadhawan/dev/ch/coach-infrastructure/node_modules/@ringcentral/sdk/lib/http/Client.js:37:53)

[2021-10-26T21:41:28.055Z] at fulfilled (/Users/ajaywadhawan/dev/ch/coach-infrastructure/node_modules/@ringcentral/sdk/lib/http/Client.js:28:58)

[2021-10-26T21:41:28.055Z] at processTicksAndRejections (internal/process/task_queues.js:93:5)

fax
1 comment
1 |1500 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.

param values look like this

Param: {

eventFilters: [

[ '/restapi/v1.0/account/+1XXXxxxXXXXX/extension/101/fax?direction=Inbound'

],

deliveryMode: {

transportType: 'WebHook',

address: 'https://xxxx.azurewebsites.net/api/receiveFax?clientId=xxxxx' } }

0 Likes 0 ·

1 Answer

Phong Vu avatar image
Phong Vu answered

Where did you get this info from? It is totally incorrect!

[`/restapi/v1.0/account/${process.env.RINGCENTRAL_USERNAME}/extension/${process.env.RINGCENTRAL_EXTENSION}/...

Account id is not the user name and extension id is NOT extension number. Normally you don't need to specify the account id, use the tilde sign '~' instead. Same for the extension id. But for any reason you want to specify the account id and/or the extension id, read the account info or the extensions to find out the ids.

[`/restapi/v1.0/account/~/extension/~/...
1 |1500 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.

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