How to open chatbot on webhook feed event - facebook

I subscribed my webhook to the 'feed' events, however. Is there any way to open the chatbot to the user that comments or do anything on the page?
Bearing in mind that I need to have a app scoped fb_id for that user to send messages to them.
Thanks.

Got it!
You can't exactly open the chatbot itself after a comment or post etc. What you can do is to POST"private_reply" to the user, then your chatbot webhook can monitor for any further messages.
To do so, you can use the following endpoint: https://developers.facebook.com/docs/graph-api/reference/v2.12/object/private_replies

Related

How to reset unread_count on Facebook Messenger API?

So I created a ChatBot with Messenger API and I get the messages that has been sent to the Facebook Pages. I also get the unread_messages which is from "unread_count" but I couldn't find how to update the unread_count for each conversation. There is no answer for that in the docs.
It doesn't go away when i send message from my chat. It only goes 0 when I manually login to https://business.facebook.com/ and click the chat.
There is a "sender_action" parameter which has "mark_seen" indicator but it is only for visual seen. It doesn't do anything on the unread_count.
Do I have to handle this on my backend or Facebook API has the solution?

Facebook Bot: Message Mentioner

I'm trying to build a bot that would message anyone who mentions (#PageName) it. I have set up the mention webhook for my bot so that whenever anyone mentions my page in a comment or post, I receive a notification. Unfortunately, Facebook doesn't make it easy to message the person who mentioned my page, since there are different page IDs and messenger IDs. I am able to fetch the user ID from the mention by fetching the from field from the graph API, but is it possible to convert this user ID to a messenger ID so that I may actually message the user?

Facebook Chatbot delete messages by id

does anybody know if it is possible to delete messages by id.
For example I have an update for my content so that the user must not see any outdated messages. Didn't find anything in the graph API...
Message docs
thx
franzus
Facebook does not allow you to delete messages using the Messenger API, or the Graph API
I am not aware or, nor have found documentation for, a method that does DELETE operations (or UPDATE for that matter) on a FB Message.
The Messenger Docs provide methods for sending messsages, subscribing a page to your application's webhook, retrieving user profile information, and setting various options for your bot.

Facebook Messenger Bot Daily Push Notification, How?

In cnn fb messenger bot if i write subscribe they show a message like "Got it. I’ll send you top stories every day." and then they daily send me top stories at fixed time. How they do it? I created an fb bot for my site without this but i can't understand how i add this. can anyone tell me basic instruction for this?
The idea is simple. When you send "subscribe" to the bot, the bot server would add a record according to the sender_id to their database or memory , then the bot server could set a timer to distribute the news messages to those sender_id who have subscribed for the news.

Inviting users to an event - notification

I have an exsiting event which I'm trying to invite users to using this method:
https://api.facebook.com/method/events.invite
?eid=EID
&uids=UIDS
&access_token=ACCESS_TOKEN
...this sort of works, in that the invited user gets a post to their wall like this:
Test Event — 19 March at 14:08.
User invited you · View · Join
But my problem is, the invited user DOESN'T get a notification.
The code is taken from here:
http://developers.facebook.com/docs/reference/rest/events.invite/
But when I run if from there, which is identical to my above code, the invited user DOES get a notification.
What am I doing wrong / missing?
Thanks
You are using a deprecated method and should switch to using graph api requests.
In this case, you can use the Event object in the graph.
Doing the same thing with the graph api should look something like:
https://graph.facebook.com/EVENT_ID/invited/USER_ID
or
https://graph.facebook.com/EVENT_ID/invited?users=USER_ID1,USER_ID2,USER_ID3
(You should have the create_event permission and an active access token of course)
This is copied from the document, under the invited section. You might also might want to check the attending, maybe and declined sections.
You can use the Graph API Explorer tool to test graph calls.
Edit
I'm sorry for not including this with my original answer:
The invitation made by the graph api (or the deprecated REST) does not result in notifications in the users' side.
You can find a few more threads about this subject here:
Invite user(s) to event with notification - works manually but not with Graph API
Facebook: No Notification when App sends event Invites via Open Graph
invite for an event by graph api doesn't send notification
But the best indication for this being the case can be found in this bug ticket: Bugs - No Notifications on Event invites via Graph API.
Notice the response from facebook:
event invites do not currently render an on-site notification, this is
a deliberate limitation of the API Event invites made this way will
still increment the counter in the 'events' bookmark and add the event
to the user's events list
Hope this clarify things.