0

I followed these steps and created a test user and a test page and now I can send and receive messages if I login with the test user.

Is there any way to send/receive messages via facebook API while the sender/receiver is the test user and not the page itself?

Thanks

Noam
  • 1,018
  • 7
  • 18
  • Unclear what you are asking. You can not exchange the user for the page or vice versa in a bot conversation, that doesn’t even make sense. – CBroe Dec 15 '16 at 15:04
  • I don't want to exchange(?) them. Facebook API supports sending a message as the page, and I want to send a message with the API as the test user I created. – Noam Dec 16 '16 at 18:35
  • That still doesn't make sense. Do you want the test user to reply to a message the page sent it? Or do you want the test user to start a conversation with a page bot? In that case, log in as the test user (can be done from within app dashboard), and reply or start a conversation the same way a real user would. – CBroe Dec 16 '16 at 19:45
  • Yes, also if you create the test user with the API you get the email and the password and you can login freely, but I want to test the chatbot that connected to the page automatically (without login, only with the API). I don't need the page to start the conversation, the test user can start it. – Noam Dec 16 '16 at 20:51
  • _"but I want to test the chatbot that connected to the page automatically (without login, only with the API)"_ - there is no way to do that with real users, so it would make no sense if it was possible with a test user (which are supposed to behave like real users as closely as possible, otherwise they would be rather pointless.) – CBroe Dec 16 '16 at 21:12
  • probably there is a miscommunication between us. I can send messages to a page and test the bot that connected to the app. Check out the link in the original question. – Noam Dec 18 '16 at 11:14

1 Answers1

0

Facebook doesn't support sending or receiving messages as a user - you can only do this as a page via the Messenger Platform API for bots like you're already using.

There is a Graph API endpoint for reading messages, but this states that it is "a Pages-only endpoint". The lack of a documentation for sending/creating a message is indicative of it not being supported - see here https://developers.facebook.com/docs/graph-api/reference/v2.8/message

Sam H
  • 174
  • 4
  • Yeah, I read most of the documentation and didn't find a way. Thought maybe the crowdsource way will work – Noam Dec 16 '16 at 18:38
  • Depending how you've implemented your bot, you could perhaps add a layer of abstraction over Facebook and support different providers, then add a new provider which is for testing purposes, so that you can write a test to send a particular message and receive a particular response – Sam H Dec 20 '16 at 12:20