Unable to setup Webhook -- "URL" is not valid



Following https://dev.twitter.com/webhooks/reference/post/account_activity/webhooks

Using consumer key and secret that matches the right development and all that jazz.
I can do other REST requests with the same TWITTER:Rest::Client instance. So configuration is not an issue.

When I try to do this

::Twitter::REST::Request.new(instance, ‘post’, ‘/1.1/account_activity/webhooks.json’, {url: ‘https://8766f276.ngrok.io/webhook’})

All I get is

Puma caught this error: Webhook URL does not meet the requirements. Please consult: https://dev.twitter.com/webhooks/securing (Twitter::Error::BadRequest)

That URL is valid AFAIK. I know the next step is to do the CRC check like explained here https://dev.twitter.com/webhooks/securing

but I am not receiving that request, it’s just throwing an exception. No other request is ever received.

What is twitter expecting for the URL? I’m at my wits end trying to figure this out…


There are some things to check in this thread - it could be a response time issue, for instance.


I was getting this too. In my case it was response time causing the problem (I was developing locally with ngrok) - once I sorted that out, everything worked. So perhaps you can try using something like https://tools.pingdom.com/ to check your endpoint response time.

You need to make sure your endpoint is responding in less than a second (and comfortably so) - and don’t forget it will be checked daily so will consistently need to respond quickly.

As @andypiper suggests you should check out that thread and go through the steps one by one.