question

Jeff Craig avatar image
Jeff Craig asked Phong Vu commented

Webhook Incoming Call All Users In Organization

I'm creating an app for my organization that does a handful of customized things that RingCentral does not do. This is my first time to use the RingCentral API and I'm stuck on how to get the Incoming Call webhook to work for all extensions in my organization. I'm using the .NET SDK and right now I have:

var rc = new RestClient(CLIENT_ID, CLIENT_SECRET, SERVER_URL);
await rc.Authorize(USERNAME, EXTENSION, PASSWORD);
await rc.Restapi().Subscription().Post(new CreateSubscriptionRequest
{
     eventFilters = new[] { "/restapi/v1.0/account/~/extension/~/incoming-call-pickup"
     deliveryMode = new NotificationDeliveryModeRequest
     {
         transportType = "WebHook",
         address = IncomingCallWebHookAddress
     }
});


But this seems to only set up the webhook to be fired for events on this one user's extension, even though the user is a Super Admin.

Is it possible to set up this webhook so that it fires each time an incoming call comes in for the over 100 users in our organization? It seems like this would be a nightmare to manage long term unless I can just have the super admin grant permissions for all extensions.

Thanks in advance!

authentication
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 answered Jeff Craig edited

Just change the event filter with this:

"/restapi/v1.0/account/~/incoming-call-pickup"

Make sure you login with a super admin extension.

1 comment
1 |3000

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

Jeff Craig avatar image Jeff Craig commented ·

Thanks for the suggestion but this doesn't seem to work. Any idea where I am going wrong?

I authenticate as the super admin and when I try to use this event filter I get:

Content: {"errorCode":"CMN-101","message":"Parameter [eventFilters] value is invalid","errors":[{"errorCode":"CMN-101","message":"Parameter [eventFilters] value is invalid","parameterName":"eventFilters"}],"parameterName":"eventFilters"}

Code used:

await rc.Restapi().Subscription().Post(new CreateSubscriptionRequest
{
   eventFilters = new[] { "/restapi/v1.0/account/~/incoming-call-pickup"},
   deliveryMode = new NotificationDeliveryModeRequest
   {
      transportType = "WebHook",
      address = IncomingCallAddress
   },
});
0 Likes 0 ·
Rahul G avatar image
Rahul G answered

Thanks Phong - Changing to the below worked for me.

"/restapi/v1.0/account/~/incoming-call-pickup"
1 |3000

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

Woodrow Chin avatar image
Woodrow Chin answered

Is this EventFilter still valid? "eventFilters":["/restapi/v1.0/account/~/incoming-call-pickup"]

I got a Bad Response error


"errorCode":"CMN-101","message":"Parameter [eventFilters] value is invalid","errors":[{"errorCode":"CMN-101","message":"Parameter [eventFilters] value is invalid","parameterName":"eventFilters"}],"parameterName":"eventFilters

1 |3000

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

Woodrow Chin avatar image
Woodrow Chin answered Phong Vu commented

If I wanted to get notified every time an outbound call is made for any of our extensions, can I use this?

"/restapi/v1.0/account/~/extension/~/telephony/session"


1 comment
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 ·

For getting notification on every extension, use the Account level event filter

/restapi/v1.0/account/~/telephony/sessions

For getting only outbound calls, use the direction params

/restapi/v1.0/account/~/telephony/sessions?direction=Outbound
0 Likes 0 ·
Woodrow Chin avatar image
Woodrow Chin answered Phong Vu commented

Thanks Phong.

Was missing leading "/"



1 comment
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 ·

Actually, your filter was missing the 's' as it must be '/sessions'

0 Likes 0 ·
Phong Vu avatar image
Phong Vu answered

All,

Not sure about the "incoming-call-pickup" event anymore but it seems that it is not supported.

To receive an event of a call gets connected, simply use the /telephony/sessions event filter with the direction=inbound, then detect the connected status of a call

/restapi/v1.0/account/~/telephony/sessions?direction=Inbound

Read this article for further info about telephony session notifications.

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