howdyai / botkit

Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
MIT License
11.49k stars 2.28k forks source link

The URL couldn't be validated. Response does not match challenge (Messenger) #287

Closed dudeofawesome closed 8 years ago

dudeofawesome commented 8 years ago

I'm trying to get the basic demo bot up and running with Facebook Messenger.

I've had a two issues with the demo so far:

  1. When I try to verify and save the new webhook configuration, I get an error message. The URL couldn't be validated. Response does not match challenge, expected value = '{{valuehere}}', received='OK'.
    • Here are a few things I have verified
      • I have the callback URL set properly to https://{{mybotnamehere}}.localtunnel.me/facebook/receive, and the bot is definitely available there.
      • I have the verify token set properly both in the Facebook page and in my Foreman .env file (which is getting used)
      • I have the page token set properly in my .env too.
    • I've looked through previous issues mentioning this, and this are all the pitfalls they found, so I'm wondering if the API has been updating in a breaking way on Facebook's end?
  2. The version of command-line-args to use is not specified anywhere, and the latest version has broken compatibility. cli.parse() no longer exists, instead, the object that used to be returned by that method is now set to cli.
    • Easy enough fix, but not super obvious when you've never used command-line-args before. Might want to update the demo source to match the newer release.

I fixed the 2nd one, but I can't seem to get around the first.

nperera0 commented 8 years ago

works fine for me , did you try passing in arguments in command line page_token= verify_token= node facebook_bot.js [--lt [--ltsubdomain LOCALTUNNEL_SUBDOMAIN]]

mertnesvat commented 8 years ago

Should we change LOCALTUNNEL_SUBDOMAIN variable to something else? If so I did try to set it goldenknife than https://goldenknife.localtunnel.me/facebook/receive would be my domain?

I couldn't find domain to add webhook :( when I pass arguments with page_token= verify_token= node facebook_bot.js [--lt [--ltsubdomain LOCALTUNNEL_SUBDOMAIN]]

I get response like below,

info: ** No persistent storage method specified! Data may be lost when process shuts down.
debug: Setting up a handler for message_received
debug: Setting up a handler for message_received
debug: Setting up a handler for facebook_postback
debug: Setting up a handler for message_received
debug: Setting up a handler for message_received
debug: Setting up a handler for message_received
debug: Setting up a handler for message_received
debug: Setting up a handler for message_received
info: ** Starting webserver on port 3000
info: ** Serving webhook endpoints for Messenger Platform at: http://MY_HOST:3000/facebook/receive
ONLINE!
debug: Successfully subscribed to Facebook events: {"success":true}
debug: No handler for tick
debug: No handler for tick

But what is MY_HOST ? what is my domain?

peterswimm commented 8 years ago

Did you get this working? if this is still a problem please let us know.

amplicity commented 7 years ago

I did have issue 1 that OP noted on most recent botkit. To solve, I switched validate_requests: false.

peterswimm commented 7 years ago

@amplicity did you happen to catch which requests were failing validation? Perhaps it's too robust versus what Facebook expects.

dinshawr commented 7 years ago

I am facing given problem

The URL couldn't be validated. Response does not match challenge, expected value="182436379", received="Invalid verify token"

any solution for this https://github.com/netguru/messenger-ruby/issues/54

peterswimm commented 7 years ago

@dinshawr are you seeing this problem with the botkit facebook starter? Do you have the correct secrets setup with your platform configuration? We posted a guide here for Botkit, but it should apply to anyone:

https://github.com/howdyai/botkit/blob/master/docs/provisioning/facebook_messenger.md

F-Makhokha commented 7 years ago

Im still experiencing the same issue

rachaelcodes commented 6 years ago

Not sure if this helps, but I had the same problem until I wrapped my verify token string in ' ' marks in my .env file.