Can a Messenger bot send messages to new users using their phone number through Facebook Messenger Customer Matching? - facebook

I've been reading the documentation for Messenger's Customer Matching feature, and it is very unclear to me what it actually does.
My main question: through Customer Matching, can my page directly message people through their phone numbers without their having to message the page first?
If the answer is yes, then why hasn't this been working for me on my own phone number? I can send messages to myself after having messaged the page first, but receive a "No matching user found" error if I delete the conversation and have the bot message first.
If the answer's no, then what is the use of Customer Matching at all?
Please don't direct me to documentation, I've been through everything and this is still unclear. Would appreciate comments from those who have successfully used this feature. Thank you!

Related

Can't get Google Chat messages with Gmail API

What are the details of your problem?
Until recently, in my own web application, I used the Gmail API to retrieve Google Chat messages as follows.
I was able to get it from "Label: CHAT" by executing as follows.
(1) Acquisition of thread ID belonging to CHAT label
https://gmail.googleapis.com/gmail/v1/users/me/messages?labelIds=CHAT
(2) Get message information from thread ID
https://gmail.googleapis.com/gmail/v1/users/me/threads/[Thread ID]
However, it seems that it has been impossible to obtain it since around December 2022, and when I searched for "in: chats" in Gmail, the messages after December 10th were not displayed.
Any method is fine, so I would like to be able to get Google Chat messages as before.
Anyone know the cause and solution?
Please check.
I also tried using the Google Chat API to see if it was possible to get messages, but I could only get messages in the space, and I couldn't get direct messages, so I wasn't able to use it.
I checked all the messages in the labels that can be obtained at "https://gmail.googleapis.com/gmail/v1/users/me/labels", but it seems that chat messages are not included.
Also, in another answer, there was a description that the state included in the Gmail API was a bug, so it is possible that this bug was adapted and it was not displayed, but in that case, there is another way to deal with it. Are you there?
Access CHATS label with Gmail API

How to send message to specific facebook user from website?

My goal is to make a website, in which user could customize a photo and then provide his friends indicators like name or id. My next task is to fetch that info from database and send messages on specific date to provided users. Ex birthday wishes, greetings, and so on.
I studied facebook send api for a few days now and couldn't find solution for myself. If I want to send message, I need to have Page-scoped id of user, which is acquired when the person text you first, which is not desired, because person wouldn't know what it is.
Also I was looking into Customer matching API, also seems to require the same PSID. The next thing I checked was Send Dialog API, which seems to send messages instantly, but not on the specific date. Also I checked unofficial facebook-chat-api, which asks for user ID, whereas I can find my id, I couldn't find ids of my friends.
So I just want to know is it even possible, if yes, I'd really appreciate your help.
User to User communication is not possible (and not allowed) in an automatic way, there is no API for it except for the Send Dialog. The Messenger platform is for page to user communication only.
Do not use inofficial tools, they are not allowed and might get you banned.

Start conversation without user interaction in Facebook Messenger

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

FbChatBot mark message as Read

i am developing fb chat bot, and i want to mark the message as read so that when the moderator of our fb page view the message part, they won't see so many unread messages even though the fb chat bot has already replied that user and they don't need to click that message just to mark it as "read".
How can i achieve this? I am trying to use this API: but it doesn't work.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions
You can not mark message as read (as of now), but the best way I deal with this is to use Handover Protocol
When your bot reply the message, it won't appear in INBOX, but it goes to DONE box instead.
When bot cannot answer, you can let your bot pass thread to INBOX. Then the moderator of page manually answer it. (and mark as DONE afterward)
Follow the instruction here to set it up:
https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control
(Note: You can pass thread to page inbox and then take thread back immediately. I will notify to INBOX, but your bot can still work with users.)
When you use the API you sent here (Facebook's Send API), you only mark the message as "seen" from the bot on the Messenger Chat that you have with your users. This doesn't affect the messages inside your Page's inbox.
Unfortunately, there is no way to mark messages as read inside your Page's inbox.
Is this new feature of fb bot? Thanks btw! I will try to check this.
Is there any side effects in Marking the message as done ???
To answer your question:
There are some bugs within the Inbox/Pages Manager mobile app. You won't see the messages in DONE folder if your admins are using Pages Manager mobile app for now.
I've reported the issue and working with them to solve it. However, you can still see those messages in DONE folder if you use a computer and go into your page's Inbox.
NOTE: It seems that messages moved to Inbox will be marked as seen (not bolded). This may be a little confusing if your admins don't mark each conversation as DONE after admin finishes conversation with the users.

Monitoring new likes and automatically sending a private message

I would need to write a script in order to automate this task:
Monitor new likes on a Facebook Page periodically.
When a new like is detected, identify the person who gave it
Send them a private message, thanking them and pointing them to additional resources that may be of their interest.
Would this be feasible using the Facebook API? The documentation strikes me as a little unwelcoming for the casual observer, and I'm not sure whether this is impossible or it's just that I haven't dived deep enough. Are the three steps above doable using the API?
You can use a cron job to get the number of likes of a Page with the /page-id endpoint.
You can´t get the fans of a Page with the API, and you can´t get the "last liker" either.
Auto-sending and message prefilling is not allowed (it would be spam anyway), and you can only reply to use messages as a Page. You can´t initiate a conversation.