Twitter Account Activity Api 214 Error Response




My twitter app have access to account activity. and I’m trying to implement Twitter Webhook. When am trying to make post request to account_activity/webhooks am getting this error

stdClass Object
    [errors] => Array
            [0] => stdClass Object
                    [code] => 214
                    [message] => Webhook URL does not meet the requirements. Please consult:

Here is the request

$result = $twitter->post('account_activity/webhooks', [
    'url' => urlencode('')

and for CRC Challenge am doing this in PHP

if (isset($_GET['crc_token'])) {
    header('Content-Type: application/json');
    $sha256_hash_digest = base64_encode(hash_hmac(
        '<Consumer Secret>'

    echo json_encode([
        'response_token' => "sha256=$sha256_hash_digest"

As per Twitter guidelines, output response is
valid json with response_token as output
Latency is below 1 sec

When I try I don’t get any GET request from Twitter for CRC Challenge.


Hi @haridarshan2901 haridarshan2901,

I took a look at your webhook URL and it appears that the latency is currently around 1.6 seconds. I verified this using the following method:

Please work to lower your latency to less than 1 second and let me know if you continue to have issues.




Thanks @Harris_0n

Our server is in India (Mumbai region) so can you please me know from which region Twitter is hitting the url so that we can reduce the network hops to reduce the latency


Worst case scenario due to failover, etc is you will be hit from a US West data center. We have data centers strategically placed around the world, but we cannot disclose and I do not have the information of exact regions/locations. I can tell you we do have a few developers operating servers in India without latency issues.


Hi @joncipriano / @Harris_0n ,

I’ve deployed my code on AWS EC2 to reduce the latency but still am getting

stdClass Object
    [errors] => Array
            [0] => stdClass Object
                    [code] => 214
                    [message] => Webhook URL does not meet the requirements. Please consult:

Here is the url

Pingdom Result (From San Jose, California, USA):


@haridarshan2901, latency looks great! However, the URL isn’t returning a valid JSON response with response token.


@joncipriano , I checked again by directly access the url with get param

And output am getting is valid json response


Another thing is when am making POST request to ‘account_activity/webhooks’ am not getting hit on my server from twitter with crc_token

$result = $twitter->post('account_activity/webhooks', [
    'url' => urlencode('')


@Harris_0n / @joncipriano

I’m stuck with this, Kindly help.

Since I’ve deployed it on aws so latency shouldn’t be an issue but if still latency is the issue please let me know and the url is giving valid json response with response_token as output.

But whenever I am making post request am not getting crc_token from Twitter


Your generated response token looks long. Can you share your consumer key? Please don’t share the secret or other access tokens here.



Here is the Consumer Key: 68QufYuG7vNzUb7rKt67i1Iv8

In php am doing like this to generate the response token

echo json_encode([
	'response_token' => 'sha256='.base64_encode(hash_hmac(
		'<Consumer Secret>'


I hope it’s fine for me to post my issue which is identical to @haridarshan2901’s under this thread. Please pardon me if not, this is my first post in the forums

I’m also trying to create a new webhook like @haridarshan2901

Whenever I use URL: “”, I get the 214 error which @haridarshan2901 stated in his post. Also, checking the server logs reveals that there was no CRC validation call from Twitter to the endpoint, which indicates that the issue is not latency.

However, when I use this URL: “” which is a ngrok pointing to the same application on my local computer, using the same consumer key, everything works fine and the webhook is created successfully

App name is “ChatDesk Trends”.

2017-07-19 17:54:50.409: Creating Twitter webhook with URL:

twitter4j.TwitterException: 400:The request was invalid. An accompanying error message will explain why. This is the status code will be returned during version 1.0 rate limiting( In API v1.1, a request without authentication is considered invalid and you will get this response.
message - Webhook URL does not meet the requirements. Please consult:
code - 214

Invalid response token


I got it working. Documentation says the url should be url encoded but it worked when i sent it raw url instead of encoded url.


Hi Haridarshan,
I am Remya…
Can you help me to implement account activity api in my site…
While I am trying this I am getting an error message Error :32 , could not authenticate you.
I am stuck with this…




Hi Remya,

Is your twitter app authorized for account activity. If not then first get it approved from Twitter. Here is the link for the form


Hi Hari,

Thank you for your reply. I have submitted that form at 29th September. How long will it take to approve…?

Account Activity API: Got Error Message

We’re onboarding new developers to the beta API gradually, and review the applications a couple of times a week. We appreciate your patience. Thanks!


Try base64_encode(hash_hmac('sha256', $_GET['crc_token'], '<Consumer Secret>', TRUE)
PHP hash_hmac() is return string, But Python is return bytes


HI @haridarshan2901, I am getting below error while registering webhook url.
[{“code”:261,“message”:"Application cannot perform write actions. Contact Twitter Platform Operations through"}]

My app is approved for Beta activities.

Consumer key is: BPntVVFQDCBjl7WPSoyhYFW16

Can somebody help me?