Question

subscription to inbound faxes failing...

  • 27 October 2021
  • 2 replies
  • 262 views

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)


2 replies

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' } }

Userlevel 1

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/~/...

Reply