Masroor
Masroor

Reputation: 1604

Facebook messenger platform webhook Verify Token not validated

I've created a facebook app on facebook developers I've setup a local rails server and exposed it to public internet using ngrok. I'm receiving facebook's webhook validation GET request and I'm returning the hub_challenge code in response. The response status code is also 200. I've provided a secret Verify Token which is required to set up a messenger webhook. But after all this I'm getting error

The Callback URL or Verify Token couldn't be validated. Please verify the provided information or try again later.

I've checked that the request is received and the response being sent back to the facebook server, but don't know why it fails and says Verify Token couldn't be validated. Is it some special token that I have to get from somewhere from facebook messenger platform? Currently I've provided it my own secret token. Any help will be appreciated. Thanks

Upvotes: 0

Views: 4666

Answers (1)

Redoy Kumar Das
Redoy Kumar Das

Reputation: 47

when I verify Facebook Webhook with my website i got that kind error

 The URL couldn't be validated. Response does not match challenge, expected value="1421256154", received="1421256154\u003Clink rel=..."

My code

public function verify_token(Request $request)
{
    $mode  = $request->get('hub_mode');
    $token = $request->get('hub_verify_token');
    $challenge = $request->get('hub_challenge');

    if ($mode === "subscribe" && $this->token and $token === $this->token) {
        return response($challenge,200);
    }
    return response("Invalid token!", 400);
}

my code everything is ok .I am using laravel thats why APP_DEBUG=true defalt when I change it APP_DEBUG=false its working and my problem solved.

Upvotes: 0

Related Questions