Facebook Messenger Inbox in a Web Dashboard - facebook

I am creating a web dashboard and want to integrate my facebook page messenger inbox on the dashboard, so we do not have to login into facebook or messenger to view and reply to the messages we have received on FB. For example the inboxes that frontapp, smooch provide.
I am not sure if I need to save the messages we get in webhooks and the replies also or we can access it through API.
I am also confused that if I create an app and connect that to the dashboard , that the user can reply from the dashboard and the message will be delivered to the user through the app, is it possible to send the message after the 24 hour window (plus 1 message) fb allows for apps if they reply from FB app, or it considered as bot as the messages are delivered through app.

You can get the page conversations:
https://developers.facebook.com/docs/graph-api/reference/v2.12/page/conversations
And then respond to them by conversation ID:
https://developers.facebook.com/docs/graph-api/reference/v2.12/conversation/messages

Related

Can't use test user to access Facebook page with Messenger Bot app

I am trying to setup my first Facebook bot by following this sample project in Glitch, connected to this quick start help page.
I have logged in with a real user, then created an app and added a messenger product as per the instructions. I have set the webhook, I have also created a page with this user, and subscribed the messenger bot to it using the app dashboard.
I can access the page with the real user and I can send messages to the page and the bot responds to those messages as expected. So far so good.
Now I would like to create test users, so that I can access this page and send messages with other users. I have followed the procedure indicated here to create such test users.
The problem is that those test users can't access the page: "Sorry, this content isn't available right now"
I have found this and this answers, which both point to this explanation.
Basically, the page the bot subscribes to must be created by one of the test users with manage_pages and pages_messaging permissions. Like this I can create other test users which can connect to the test page and send messages just fine. However, the bot is not properly subscribed to this new test page, despite following the provided steps. I followed all of them and got the success response in the subscription step:
https://graph.facebook.com/v2.9/me/subscribed_apps?method=POST&access_token=<TEST_USER_PAGE_ACCESS_TOKEN>
Still, the bot is not connected to the test page. I can send messages back and forth between test users on the test page, but the bot does not respond and I get no activity logs in the webhook.
In a nutshell:
If I create a page with a real user, I can subscribe the bot successfully to the page, but I can't access the page with test users.
If I create a page with a test user, I can access the page with other test users successfully, but I can't subscribe the bot to the page.
How can I solve this or at least troubleshoot it?
Facebook API v2.9
The test user cannot access your real facebook page but you can message your bot (logged in as a test user) via the messenger short link (m.me/your_bot_link).
I used that in the testing steps (and video screencast) for the app permissions review submission.

Facebook APP is blocked from sending messages

We use SAP CRM Interaction Center to answer Facebook posts/messages to our company page. We created a Facebook APP to manage our pages using Facebook API and Page_Access_Token.
Scenario:
Facebook User sends private message to one of our company pages.
Message is delegated to the Interaction Center Inbox.
Interaction Center Agent replies with a private Message.
Private message is received by Facebook User.
It working fine when Facebook User uses messenger on his/her mobile phone or uses Desktop PC/Laptop and is logged in the whole time. When he/she logs off and logs in again (Desktop PC/Laptop) the private message sent by Interaction Center/Facebook APP is replaced by follwoing text:
"This message was removed because the APP it's being sent from is
blocked from sending messages"
We also tried to use Graph API Explorer for testing and it does not work:
Following documentation we used:
post-> /v2.4/thread_id/messages?message="Test"
Is also working if the private message was sent to my account. I created the APP and I am administration of our page.
Facebook APP: All permissions are selected (maybe we do not need all); Status is in Development; It is not a test APP;
Based on the cases where private messaging is working I assume that everything is correct on SAP CRM side. But we clearly missed something when we created the APP.
Any ideas how to solve this?
Do we have to submit the APP for review? (It should not be public)
Is it possible that Facebook considers the messages as spam and blocked the APP automatically?
Thanks,
SImon

Facebook reply to message

I face an issue with replying (from with in an app) to facebook messages received in an application. The facebook is connected via oauth to this app and the FB messages will be delivered into this app.
Jijo AMT (jijo#facebook.com)sent a FB message TO Anjaly AMT(anj#facebook.com).
The Anjaly AMT facebook account is configured in the app and hence the message is delivered in app. Anjaly want to reply for this message to Jijo. Using an email client in app she does it from an email a#amt.in. Although user Jijo gets this message in facebook, it cant be recognized as reply and falls in facebook as a new message.
I would like to know, how the reply can be recognized as a reply to the FB message.( can we take use of any header info, message id etc)

Can a Facebook Application send a message to its users

Is it possible for a Facebook application to send a message to its users ? Sending the Message that we get next to notification(inbox) .On behalf of the Application. ?
The facebook api does not allow sending private messages (inbox) at all, not for an application or a user by an application.
For user (with a user access token) applications can use the Send Dialog or the Chat API.
As for sending user notifications from the application, check the Social Channels and Requests documentation.

Sending messages from facebook App to the User

After google search, all most all the posts said it is not allowed to send messages from Facebook App to friends. May be I did not understand completely what the other people are saying about sending messages.
Is it allowed to send messages from a facebook app to the user who added the app to his account? (Not to the user's friends)
There are two ways to do it: email and through the application dashboard.
It is not possible to send a mesage to a user's Facebook message inbox from an application.
Some info on emailing users: http://developers.facebook.com/blog/post/355
Info on the dashboard: http://developers.facebook.com/docs/reference/rest/dashboard.addnews/
You can use FBML to invite friends.FBML