News & Announcements User Community Developer Community

Welcome to the RingCentral Community

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

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
Webhook stopped working
Tags: webhooks, subscription, rest api
Nov 14, 2023 at 9:38am   •   2 replies  •  0 likes
Slice Supplies


Webhook is not working in the sense that nothing hits my endpoint when an SMS comes in, but when i subscribe, it does send the validation token (so I know the end point is reachable). It was working perfectly fine and then just stopped, I have deleted the subscription and resubscribed.

Any help would be appreciated!


@app.route('/webhook/ringcentral', methods=['POST'])
def ringcentral_webhook():
        validation_token = request.headers.get('Validation-Token')
        if validation_token:
            return make_response('', 200, {'Validation-Token': validation_token})
        data = request.get_json(silent=True)
        if data:
            sender = data.get('body', {}).get('from', {})
            phone_number = sender.get('phoneNumber', 'Unknown Number')
            sender_name = sender.get('name', {phone_number})
            message_subject = data.get('body', {}).get('subject', 'No subject')
            text = f"New SMS from: {sender_name}. Message: {message_subject}."
            return jsonify({'status': 'success'}), 200
  "No JSON payload received.")
            return jsonify({'status': 'error', 'message': 'No JSON payload'}), 400
    except Exception as e:
        logging.error(f"Error processing the webhook data: {e}")
        return jsonify({'status': 'error', 'message': str(e)}), 500

the subscribe code:

    def clear_webhook_subscriptions(func):
        def wrapper(self, *args, **kwargs):
            return func(self, *args, **kwargs)
        return wrapper

    def subscribe_for_notification(self, event_filters=['/restapi/v1.0/account/~/extension/~/message-store/instant?type=SMS'], delivery_address = 'REDACTED'):
            body_params = {
                'eventFilters': event_filters,
                'deliveryMode': {
                    'transportType': 'WebHook',
                    'address': delivery_address + '/webhook/ringcentral'
                'expiresIn': 604800 #TODO:Rework this. can be upto 10 yrs. 315360000
            endpoint = "/restapi/v1.0/subscription"
            resp =, json=body_params)

            response = resp.json()
  "Subscription ID: {response['id']}")
  "Ready to receive incoming SMS via WebHook.")
            return response
        except HTTPError as http_err:
            logging.error(f"HTTP error occurred: {http_err}")
        except Exception as err:
            logging.error(f"An exception occurred: {err}")

    def read_subscriptions(self):
            endpoint = "/restapi/v1.0/subscription"
            resp = self.get(endpoint)
            response = resp.json()
            if not response['records']:
      "No subscription found.")
                for record in response['records']:
          , indent=2, sort_keys=True))
        except Exception as e:
            logging.error(f"An exception occurred while reading subscriptions: {e}")

    def delete_subscription(self, subscription_id):
            endpoint = f"/restapi/v1.0/subscription/{subscription_id}"
  "Subscription {subscription_id} deleted.")
        except Exception as e:
            logging.error(f"An exception occurred while deleting subscription {subscription_id}: {e}")
2 Answers
answered on Nov 14, 2023 at 12:19pm  

@Phong Vu Thanks for your response. Here is an example of the output from read_subscription, I have already deleted this subscription and created a new one. Everything looks fine, and I do see a post request when I subscribe, so i know the endpoint is reachable, just nothing when we get a text.

2023-11-14 15:15:11,431 - INFO - [14/Nov/2023 15:15:11] "POST /webhook/ringcentral HTTP/1.1" 200 -
2023-11-14 15:14:58,817 - INFO - {
  "creationTime": "2023-11-14T17:32:57.920Z",
  "deliveryMode": {
    "address": "REDACTED/webhook/ringcentral",
    "encryption": false,
    "transportType": "WebHook"
  "eventFilters": [
  "expirationTime": "2023-11-21T17:32:57.920Z",
  "expiresIn": 595079,
  "id": "72f3f907-bc4f-4c85-a7fb-dREDACTED",
  "status": "Active",
  "uri": ""

answered on Nov 14, 2023 at 11:54am  

When you call the read_subscriptions method, what do you get?

First, verify if your subscription status is active. Then if it is active and you still cannot receive instant message notifications, check the phone number you send SMS messages to to see if the number is owned by the authenticated user.

on Nov 14, 2023 at 12:28pm   •  0 likes

You were right, my sandbox config loaded ,so rightfully so, we aren't receiving text messages on that number. Thank you for helping nudge me in the right direction.

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

Developer Platform
Integrated Apps
App Gallery
Developer support
Games and rewards

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