News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Setting up and receiving event notifications.
Tags: notifications
Jun 16, 2023 at 9:53am   •   2 replies  •  0 likes
Robert Goth

Thanks in advance.

Ok I have to say I do not fully understand the notification and events but I am trying.

I have a php page (notification.php) at

"https://myurl.com/webhook-notification.php?webhookcallback"

I used the code from https://developers.ringcentral.com/guide/notifications/webhooks/quick-start to set up a notification. with the following settings

 $DELIVERY_ADDRESS='https://myurl.com/recall/ring/webhook-notification.php?webhookcallback';


  $params = array(
        'eventFilters' => array(
            '/restapi/v1.0/account/~/extension/~/message-store/instant?type=SMS',
            '/restapi/v1.0/account/~/telephony/sessions'
        ),
        'deliveryMode' => array(
            'transportType' => "WebHook",
            'address' => $DELIVERY_ADDRESS
        ));

I opened a terminal window and started PHP server and ran the following

$ php -S localhost:5000

when I load the URL page in a browser I get the following Response:

 {"uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/subscription/############","id":"################","creationTime":"2023-06-16T16:17:56.455Z","status":"Active","eventFilters":["/restapi/v1.0/account/#########/telephony/sessions","/restapi/v1.0/account/#######/extension/######/message-store/instant?type=SMS"],"expirationTime":"2023-06-23T16:17:56.455Z","expiresIn":604799,"deliveryMode":{"address":"https://myurl.com/recall/ring/webhook-notification.php?webhookcallback","transportType":"WebHook","encryption":false}}

SO if I understand it correctly I should now be notified when a text or sms is sent by a push notification to the following address

https://myurl.com/recall/ring/webhook-notification.php?webhookcallback

I have a code in this php page to make a log evey time the above URL page is loaded. When I call or text the sandbox number I do not get a pageload indicating to me the push notification was not sent. Any advice?

2 Answers
answered on Jun 16, 2023 at 11:12am  

Double check if your app has the SMS and Call Control app scopes.

Is your delivery address a localhost on port 5000 on your local machine? Or is it an online server? Can you post something to that address?


 0
answered on Jun 16, 2023 at 12:49pm  

It is on an online web server. I have never tried to post anything to the address from outside the local host so maybe that is the problem?\


 0
on Jun 16, 2023 at 1:09pm   •  0 likes

If it is an online server, why do you need to run the command

$ php -S localhost:5000

That command is needed only if you run the server code in your local machine and using ngrok tunnel address on the port 5000.

on Jun 16, 2023 at 1:49pm   •  0 likes

I wasn't sure what the port 5000 was for but thought I would follow the instructions on the documentation as I didn't want that to be the reason it did not work.


on Jun 16, 2023 at 1:53pm   •  0 likes

If you follow the instructions to run the server locally on your machine, then also run ngrok and get the forward address and use that address as the delivery address as instructed from the dev guide.

$ ngrok http 5000



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us