botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[Support] Facebook Messenger Bot: No replies

Open FedericoElles opened this issue 10 years ago • 30 comments

My Bot ID: cassiebot

I just connected the Facebook Messenger channel. Looks good: "Credentials have been validated." I do not see a test link however in the overview.

When I try to chat with the bot on Facebook, I see a green connected icon, but the bot does not reply at all...

cassiebot fbm

Ideas:

  • Facebook App has not been reviewed
  • pages_messaging Permission for App Review is not set in Facebook. Do I need it?
  • Slack and Webchat do work for the bot, while Skype does also not reply...
  • I did not update the bot - just added a new channel

Thank you very much for your great support so far.

FedericoElles avatar May 01 '16 07:05 FedericoElles

It does not need to be published

Sent from my tumbs


From: Federico Ellesmailto:[email protected] Sent: ‎5/‎1/‎2016 12:43 AM To: Microsoft/BotBuildermailto:[email protected] Subject: [Microsoft/BotBuilder] [Support] Facebook Messenger Bot: No replies (#204)

My Bot ID: cassiebot

I just connected the Facebook Messenger channel. Looks good: "Credentials have been validated." I do not see a test link however in the overview.

When I try to chat with the bot on Facebook, I see a green connected icon, but the bot does not reply at all...

[cassiebot fbm]https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fcloud.githubusercontent.com%2fassets%2f1033020%2f14940667%2f029e05b0-0f80-11e6-97eb-ccef3861f1b2.png&data=01%7c01%7cTom.Laird-McConnell%40microsoft.com%7c4944e55cc8f64722764808d37194558d%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=v3noMbWe6opw3IdoiPNjrBNVPxUp4Qs29bwxnwVztI4%3d

Ideas:

  • Facebook App has not been reviewed
  • pages_messaging Permission for App Review is not set in Facebook. Do I need it?
  • Slack and Webchat do work for the bot, while Skype does also not reply...
  • I did not update the bot - just added a new channel

Thank you very much for your great support so far.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/BotBuilder/issues/204

tomlm avatar May 01 '16 17:05 tomlm

I'm having the same issue. If I create a webhook URL that points directly to my site, I get callbacks from FB. But using the webhook path from the botframework channel config

https://facebook.botframework.com/api/v1/bots/[BotName], 

nothing reaches me.

genereddick avatar May 02 '16 19:05 genereddick

Hmm..I'm not certain why this isn't working. My only advice would go through the registration process again.

tomlm avatar May 02 '16 20:05 tomlm

Making a GET request to the URL (https://facebook.botframework.com/api/v1/bots/[BotName],) with the hub.verify_token and a hub.challenge gets a valid response. But POST to the same URL with FB request json returns a 200 but no content.

Further, inputting malformed JSON, or JSON that doesn't conform FB's schema returns various errors as expected, so clearly it is handling the data. But somewhere in the code it is failing to forward the request on to my app (hosted on Azure) or forwarding to a URL / signature that isn't hitting the correct API. In any case, the debugger never gets hit though I can trigger the debugger from a local request.

genereddick avatar May 02 '16 23:05 genereddick

This is compliant with the facebook documentation.

Yes, is there something you expect to happen differently?

From: Gene Reddick [mailto:[email protected]] Sent: Monday, May 2, 2016 4:32 PM To: Microsoft/BotBuilder [email protected] Cc: Tom Laird-McConnell [email protected]; Comment [email protected] Subject: Re: [Microsoft/BotBuilder] [Support] Facebook Messenger Bot: No replies (#204)

Making a GET request to the URL (https://facebook.botframework.com/api/v1/bots/[BotName],https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2ffacebook.botframework.com%2fapi%2fv1%2fbots%2f%255BBotName%255D%2c&data=01%7c01%7cTom.Laird-McConnell%40microsoft.com%7ca0890d0bb95e46b70a4d08d372e2010f%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=GuZ9G%2fleH9v%2fK8klShzwG6Fl0Hkfjxv%2bKGlrW%2bzzLnM%3d) with the hub.verify_token and a hub.challenge gets a valid response. But POST to the same URL with FB request json returns a 200 but no content.

— You are receiving this because you commented. Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/BotBuilder/issues/204#issuecomment-216395290

tomlm avatar May 02 '16 23:05 tomlm

OK, so I guess the empty response content is expected. But, my expectation, mistaken perhaps, is that a call to the facebook.botframework.com URL would take the FB request object, convert it into a botframework object and forward it to the api/messages URL associated with my app. My app would respond with some content and that message would then be forwarded on the FB API to update the messenger client.

However, in my case, a valid FB request object sent to facebook.botframework.com does not trigger a request to my API -- the debugger is never hit although I can trigger the break point using the webchat version -- and does not post to FB messenger.

genereddick avatar May 03 '16 00:05 genereddick

OK, fixed. My problem was an incorrect "Facebook Page Id".

Thanks!

genereddick avatar May 03 '16 02:05 genereddick

Same here. Facebook Page Id was wrong. Issue can be closed!

falvhb avatar May 03 '16 12:05 falvhb

Yeah, my alter ego confirmed that it does work now. Can be closed. Thanks @genereddick for sharing your solution.

FedericoElles avatar May 03 '16 18:05 FedericoElles

hi , i have issue with facebook bot,

when i use my own account , i can get reponse and receive message to my webhook.

but when i send message from an other user account , i got nothing.

is the app should be published and accepted by facebook to have access from all other users?

many thanks

barigo avatar May 03 '16 20:05 barigo

Yes, only admin/developer/test accounts can be used until the app is approved.

You can add accounts in the "Roles" tab of the FB developer portal. https://developers.facebook.com/apps/[yourappid]/roles/

genereddick avatar May 04 '16 15:05 genereddick

@genereddick I have the same issue, please how my bot can be approved ?

saibimajdi avatar Oct 07 '16 17:10 saibimajdi

@genereddick I submitted my bot Facebook App for approval but the human approving it is testing the bot using an account that is not admin/developer/test and thus the bot did not work, and the submission was rejected. How to get around this catch 22?

devonho avatar Oct 11 '16 04:10 devonho

Hi @devonho, I also submitted my bot for the approval and I noticed that some accounts has tested my bot even I don't added them as testers or developers, so I think that FB engineers are able to test the bot even they aren't testers (or developer) for a specific bot.

saibimajdi avatar Oct 11 '16 17:10 saibimajdi

@devonho As I recall, they were able to test my account without issue, so I'm sure @saibimajdi is correct. Assuming you are able to test your own bot without any problems, did they give any feedback on issues they found (either on the page below or via email)?

https://developers.facebook.com/docs/messenger-platform/app-review

genereddick avatar Oct 11 '16 17:10 genereddick

@genereddick @saibimajdi Thanks for your replies. This is reassuring; at least now I know that the FB tester accounts are not bound by the same rules. I am suspecting now that my Bot "didn't work" because the Azure webapp hosting my bot is slow to respond. It is in the free tier and doesn't have the "always on" feature.

devonho avatar Oct 13 '16 12:10 devonho

I'm having problems when try SendToConversation, there is not error, but the messages is no delivered. How can I solve this?

//var connector = new ConnectorClient(new Uri("https://facebook.botframework.com"));
 var connector = new ConnectorClient(new Uri("https://api.botframework.com"));

Help me please.

alexCQui avatar Nov 09 '16 07:11 alexCQui

I am still having this problem, verified "Facebook Page Id", APP id, app secret, page access token . All are correct. unregistered and reregisterd as well. It seems to be woking fine from bots emulator on https://dev.botframework.com/bots?id=botname page but not from messenger, "message us" opens the right page for chat as well. I am not sure what else I am missing.

ishandutta2007 avatar Jan 06 '17 10:01 ishandutta2007

Found my issue, I was using wrong Callback URL and the Verify Token. Callback URL and Verify Token has to be ones provided by microsoft. My bot had earlier authenticated using a different Callback URL and Verify Token which were directly hitting my server.

ishandutta2007 avatar Jan 06 '17 13:01 ishandutta2007

Hi,

I am facing the same issue. Verified Facebook Page Id, App ID, App secret, page access token. All are correct. Registered and unregistered and tried as well. The bot seems to work fine on webchat channel as well as the emulator. When I click on "Message Us" from the bot framework dev page, it opens up the right chat. Still when I type in something the bot doesn't respond. I have verified the Callback URL and Verify token as well and they are correct too. The errors on the bots page do not seem to update properly as soon as we try but this is the error for one of my previous trials - "There was an error sending this message to your bot: HTTP status code InternalServerError"

Note - This bot was working fine till yesterday. I made a few changes to the bot and redeployed and doesn't seem to work ever since. Assumed it might be due to my changes and reverted them and even then the same problem. I am using the C# SDK Bot Builder v 3.5.2 Any help or any guidance to debug is much appreciated!! Seem to have been stuck and not sure what else to do :-(

Thanks, Anitha

AnithaJothi avatar Feb 19 '17 13:02 AnithaJothi