Send message through Facebook API from personal account to a page? - facebook

Is their a way to send a private message on Facebook from your personal account to a Facebook page, from an external app ? (through the API or else)
Exactly as if you were contacting a page manually, by I wanna be able schedule the messages to send to the page, and let a software send it for you.
I've seen so many topics in SO but no one giving a answer to this specific situation.
Thanks

No, that is not possible.
You can not automate sending user messages at all.

Related

Can i send direct messages to my clients facebook followers using API?

I have seen services advertising that they can message the followers of pages and accounts on Facebook. I have gone over lots of different Facebook API's and several interesting threads on here but cant find a definitive answer.
Is is possible to directly message via a bot users who like a page providing obviously we have a valid admin token for that page?
Is is possible to directly message via a bot users who like a page
No, that is not possible.
All communication via the Messenger platform API (basis for “bots” in Facebook terminology) requires that the user initiates it.
And it would probably be considered spam by most people - just because I liked your page, does not mean I want to be contacted by you in any way beyond that. Posting to your page is the designated way of communicating with the people that follow your page.

Facebook Message To All Friends

Is there any way by which I can get all the friends using FB api and than message all of them.
Which approach is better to achieve it, a bot or using facebook api?
If Bot, than which bot can be used as a kickstart, which programming language is preferred?
JAVA,ASP.NET
It is not possible to get all friends - only those who authorized your App. Also, it is not possible to send a message to friends with the API, you can only use the Send Dialog and let the user specify the recipient on his own: https://developers.facebook.com/docs/sharing/reference/send-dialog
What you want to achieve would be possible with a bot though. Users can register to get messages from the bot, so you can create an alert system with it. More information: https://developers.facebook.com/docs/messenger-platform/
It would be a general alert system though, not between friends. For that, i would recommend not using Facebook but Emails.

How to test FB messenger bot with multiple users

Has anybody yet a way to interact with an FB messenger bot without using real FB accounts? I want to do automated testing and obviously not use real accounts for that.
I was not able to figure out how to allow access to a page to 'test users' or create a test page and subscribe the test app to it.
Any ideas on how to do this?
I use a wee web app I made to act as a local version of the facebook messenger api server and run user actions.
https://github.com/Fraser-Greenlee/bot_tester
On it you can write a script to define new users and their actions.
From the Facebook developers dashboard, select your app and then Roles. From Roles you can add other Facebook users as test users. It was easiest for me to use the users facebook id. Adding by email did not always work for me.
I am not aware of how to access a Facebook bot without a Facebook account. I created several fake accounts and had my friends test the bot. After testing, I deleted the fake accounts.
For more information on setting up a bot see my article Facebook Bots for Fun and Profit
The example bot is DMS Software Bot
The source code is Github fb-robot
Testing fb bot with non-fb user is currently not supported. Following are the reasons:
fb messenger requires the user to be logged
fb creates page scope ids (PSID) for each user who is interacting with the bot and hence login on fb is required
Coming to your question on testing:
you can add fb users as tester to your page and your app. Explained here. For your app https://developers.facebook.com/apps/[app-id]/roles/
Once added they will be able to send message to your bot (page) from messenger
On another note, if you are using 3rd party apps to build your bot (eg: api.ai, wit.ai) they already have emulators within the app which makes testing easier.
One easy way to achieve automated testing for messenger bots atleast is to try to mimic a request coming from FB. You can just log the request you are getting to your bot to find the signature of the request that FB sends. Then you can just pretend to be FB by sending http requests with the same signature. You will also have to add in code to respond to these http requests with your reply instead of just sending the message to FB's send API.
So in node it would be something like
sendMessage(<your reply>);
res.send(<your reply>);
Now you have an automated way of sending and receiving messages which you can use for automated testing.
However I think the bigger challenge is coming up with enough test cases. You need to use a combination of clustering over available data and classification to generate new cases.
I have been working on a tool to make this easy. So if you are interested you can sign up for early access. http://ozz.ai

Forward my received Facebook messages (chat + messages) to my email inbox, and subsequently delete them from my Facebook inbox

Facebook does not offer a feature which forwards ALL my received messages to my email inbox, and subsequently deletes them from my facebook inbox. Is there an existing application or online service which offers this functionality? If no:
I want to write a script which does exactly that. It should poll regularly if a new message has arrived. If yes, it should forward it to my email address and delete it from my FB inbox automatically, without user interaction.
Which scripting languages are suited for that task, which classes and methods? Is it advisable to move that script to a web server so it runs continuously without user interaction? How can one go about that?
Facebook does not delete anything, only you can delete inbox messages.
Anyway, what you are trying to achieve is not possible, access to the inbox is not possible anymore. Facebook removed the API endpoint for it.
You will need to use facebook graph extended permissions "read_mailbox" to read the facebook messages.
Please note that this extended permission is available only for facebook graph API version 2.3 (not available for version 2.4 and up).
You can read the facebook messages every 5/10 minutes (via graph API) and in the case of a new message you can create a new self email message with the facebook message.
You will NOT be able to delete the facebook message (read mode only)
Hope this helps.
Good luck!

Count sends through Facebook send button

Is there any way to know how much people a user has sent a message through Facebook's send
button on a website ?
If not, is there any other way to achieve this kind of thing with another plugin ?
Thanks in advance
This Document clearly mentions that if you register your domain on facebook insights, you will be able to gather analytics about the Send button.