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
"WebHook server response is invalid" when creating a new subscription
Tags: sdk
Dec 16, 2019 at 12:15pm   •   3 replies  •  0 likes
Catie Sessions

Using a sandbox app, PHP SDK. Trying to create a subscription, with the payload

Array
(
    [eventFilters] => Array
        (
            [0] => /restapi/v1.0/account/~/telephony/sessions
        )

    [deliveryMode] => Array
        (
            [transportType] => WebHook
            [address] => https://64979567.ngrok.io/index.php?m=integrations/webhooks&a=ringCentral
        )

    [expiresIn] => 630720000
)

This is what gets posted to my webhook address,

POST /index.php?m=integrations/webhooks&a=ringCentral HTTP/1.1
Validation-Token: d206fc96-ef23-4fe9-98c2-a087358446c7
Content-Type: application/json; charset=UTF-8
Accept: application/json
Accept-Encoding: UTF-8
User-Agent: RingCentral-WebHook/8.3
Content-Length: 0
Host: 64979567.ngrok.io
X-Forwarded-Proto: https
X-Forwarded-For: 192.209.29.132

This is what my webhook returns,

HTTP/1.1 200 OK
Cache-Control: no-store, no-cache, must-revalidate
Content-Type: application/json; charset=utf-8
Date: Mon, 16 Dec 2019 19:43:17 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Last-Modified: Mon, 16 Dec 2019 19:43:17 GMT
Pragma: no-cache
Server: nginx
Validation-Token: d206fc96-ef23-4fe9-98c2-a087358446c7
Vary: Accept-Encoding
Vary: Accept-Encoding
Content-Length: 0

And what I get back from the API is "WebHook server response is invalid". I'm not sure what's missing, here.

2 Answers
answered on Dec 18, 2019 at 10:29am  

I got that response also when I was using some PHP web frameworks. But this quick start way works quite reliable.


 0
answered on Dec 17, 2019 at 8:30am  

Seems to be response time. It's just quick enough as reported by ngrok, but apparently just over 1000 ms by the time it gets out of the ngrok tunnel and back to RingCentral. I guess I'll work around it for devtest, it shouldn't be an issue in our faster production environment.


 0
answered on Dec 16, 2019 at 12:46pm  

1. Webhook URL is available on the Internet (via ngrok)

2. TLS/SSL enabled

3. response within 850 ms

4. Validation-Token header is present, value copied from that posted


 0



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