I submitted my facebook messenger bot for app review and the rejection reason was "received no response".
I've tested my bot from my own account and some other testers that I added to my facebook app for testing.
However, when I try to test using the default Open Graph Test User I don't get any response. The Send Message API fails with error:
{"error": {"message":"(#100) No matching user found", "type":"OAuthException", ...}}
What am I doing wrong here? How can I send message to test users using the Send/Receive message API?
I had the same problem and got responses in the facebook developers community. It seems like it is confirmed bug:
https://developers.facebook.com/bugs/230322797329131/?hc_location=ufi
Update:
It seems to work now. Since Tuesday this week I can see reviewers sending messages to the bot and get responses in the messages of the page.
My problem was
I am sending recipient id instead sender id in my json data.
dict_to_send = {
'message': {'text': u'hello FB'},
'recipient': {'id': **'*sender_id_here*'**}
}
res = requests.post("https://graph.facebook.com/v2.6/me/messages?access_token=your_token_here", <br>data=json.dumps(dict_to_send), headers = {'content-type':'application/json'})
The FB application webhooks should be subscribed only for the following events:
messages
messaging_postbacks
subscribing to one of the others events might throw that exception.
source here:
https://developers.facebook.com/bugs/578746852290927/?hc_location=ufi
Answers below:
1) You shouldn't submit for App Review without testing to see if your stuff works.
2) I'm guessing you used the user ID from the Test User interface. If you read the docs more closely, you'll see that the user IDs used for Messenger Platform is different than user IDs you get from Facebook Login (which is what the test user interface shows). Read the "Send/Receive API" section under https://developers.facebook.com/docs/messenger-platform/implementation#send_message
Related
I would like to have a log chat on my own server by collecting them from the chat history between user and my Facebook page.
I found the document mention about message
Next after I can verify my token using ngrok get my server connected with Facebook. Then I am looking for message.
In my understanding I have to listen to my page event. But I could not found and row mentions about it.
I found message_sends in the User. But it is not what I want.
I think document might not get uptodate. In the picture it is 2 and now it is 3.
Obviously subscription to User and select message_sends is not a correct solution on my use case. My case is user send message to my page. And my page send webhook to my chatlog server. That's all.
Question:
How to connect message on my page to my webhook url?
I have to use messenger and then Subscribe To Events
I created an app in my face book account and i added a callback URL in the web hook. The verification part is success and I did the subscriptions to the topics which i need to get notifications.
I clicked the test button in each topic to send the object to my server, it is working good and i can see test response in my server. But when i get any like in my page it is not posting the notification to my server.
I subscribed to all the topics such as like, feed etc.
Do i missing something?
Is it possible to send a message to a user without the user interacting with the bot first?
I'm using the following guide to retrieve psids from users that have already connected their profile to an app that I own.
https://developers.facebook.com/docs/messenger-platform/connecting-accounts.
For users that have at least one interaction with a page that I also own, I'm able to get their id. For all other users the endpoint returns an empty array.
Im aware of customer matching but is that the only way to achieve this?
You can't send a message by bot before the user initializes the conversation.
Facebook Messanger Bot permits a standard messages, with a 24-hour interval
to reply to a message initiated by a user. In Some specific cases, Facebook permits to send a message after this time.
A message are triggerd when the user either sends a message to a company or clicks a call button for action in Messenger, or when the user requests a message from a company through a plugin, such as send to Messenger.
Check out the policies here : https://developers.facebook.com/docs/messenger-platform/policy-overview
You are correct, customer matching is your only option for this.
Just learned this today, if you have a user's phone number, you can message them unprompted. You also need the pages_messaging_phone_number permission, which you can only get by paying the $99 customer matching fee.
Check the docs on sending to phone numbers here. Customer matching docs here
I've facebook account and a fan page defined within this account.
I'm using XMPP to send private messages using the following Java code
http://yauritux.wordpress.com/2011/09/24/facebook-chat-with-smack-xmpp-api/
I can easily send and receive messages using my user id and password.
However when I try to use my page user ID I'm getting the following error:
SASL authentication PLAIN failed: not-authorized (stack below).
I tried to use pidgin but I'm getting the same error.
Let me know if you've a solution or direction on how to send a message as a page and not as a user.
Thank you in advance,
Moshe
SASL authentication PLAIN failed: not-authorized:
at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:337)
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203)
at org.jivesoftware.smack.Connection.login(Connection.java:348)
at com.maiff.was.connectors.impl.fb.FBConsoleChatApp.login(FBConsoleChatApp.java:55)
at com.maiff.was.connectors.test.ConnectorTestMain.initFB(ConnectorTestMain.java:55)
at com.maiff.was.connectors.test.ConnectorTestMain.main(ConnectorTestMain.java:18)
Pages can only "reply" to user messages, and i am not sure if it even works with XMPP. Keep in mind that the Chat API is deprecated btw: https://developers.facebook.com/docs/chat/
Meaning, after April 2015 it will not work anymore, not even with users.
For Page conversations, there is a specific API endpoint to reply to messages: https://developers.facebook.com/docs/graph-api/reference/v2.2/conversation/messages
I'm working on building an app that (among other things) uses the Facebook Graph API for Pages to reply to direct messages to a page. I send a POST request to /CONVERSATION_ID/messages as per the documentation, and everything seems to be working well.
The problem I'm encountering is that the documentation claims
"Also, a page can respond not more than twice to a user's message before the user has replied back,"
but I'm not seeing this happen during my testing.
https://developers.facebook.com/docs/reference/api/page/#conversations
I've so far sent 4 responses to the message initiated by the Facebook user that I am using to test my app with, and the Graph API has not yet given me an error message. The documentation also does not say what error message is supposed to be returned if a page attempts to send more than 2 responses to a message before the user replies back.
Does anyone know what the error message is that the Graph API returns when a page attempts to send more than 2 responses to a message?
I seem to have found the answer to my own question. While I could not find official documentation for the error messages, I found unofficial documentation for them at:
http://fbdevwiki.com/wiki/Error_codes
The error code I was looking for was there:
User has sent too many messages