Facebook Send To Messenger Doesn't Send Anything To Server - facebook

How to use Webhook event that been provided for Send To Messenger plugin, messaging_optins?
https://developers.facebook.com/docs/messenger-platform/reference/webhook-events/messaging_optins
After user click Send To Messenger button and connect with their Messenger account, the button doesn't send anything to the server. Are there anything that I'm missing?
Thank you.

Solved, figured it on my own. Ended up page access token that connect with the apps already expired.

Related

How to enable triggers from other users aside from page owner

I created a facebook Page, & a Facebook App that is subscribed to webhooks.
So I my external server was successfully able to receive messages sent from my account->my page(webhook triggers), but when other other accounts send message to my page, no webhook gets triggered.
Any leads why? Do I need my application to be submitted & reviewed by facebook team for this feature to enable?
Will appreciate any help. Thanks in advance! :)
Until you bot is approved and set to public, only users with the Developer, Tester, or Admin role can interact with it.

Facebook Messenger Platform ngrok

I try to setup a webhook for the facebook messenger api and try to forward to my localhost node.js server via ngrok. The GET request from facebook for checking the server ist working perfect. But when I send a message to my site via the messenger I dont get any response to my webhook. It works ok when I curl the ngrok address. Any suggestions ?
Thanks
I was having similar issue -
My current (semi-working) workaround is to unsubscribe my test page from the Facebook app configuration page (in the app settings page -> Messenger in the left panel -> Webhooks section), and then re-subscribe my test Facebook page. I will immediately receive Http POST message after I type something to my test page in the messenger.
Of course that can only help testing. It doesn't help in the production environment.
As long as the Facebook app you are using for the Messenger integration is in an unpublished state, i.e has not undergone a review process, only messages by admins, developers and testers are relayed through the webhook.
Check if the user you are using has the correct permission on the app.
On some occasions Facebook also stops forwarding messages, e.g if your webhook endpoint is returning errors repeatedly. Check your alert dashboard in the developers.facebook.com platform.
The solution is to unsubscribe and then subscribe a page again.
Further hints:
Depending on the framework you are using on the receiving end it might reject messages with an x-forwarded-for header in the request (Symfony 2 in my case).
Use the -host-header=rewrite option with ngrok to rewrite the request header if you run into issues like that.

Facebook - Send Message To Friend(s) with / or without API in PHP / cURL?

Apparently with the Facebook API, you can only read a users inbox, not send messages. Without doing a Javascript send dialog.
I am creating a simple script with twilio where I can call in, and save a message. Then have that message be emailed to a friend, or myself.
That's done, and easy, but people don't check their emails that often as they check a Facebook message.
Question:
Is it possible with the Facebook API, or using cURl or some other method in PHP to automatically login into my facebook account, and send a message to a friend?
My personal facebook, not anyone, but have my email and password passed into it and have the script do this automatically?
Is this possible, or against Facebooks TOS to have php remotely access and use my FB account?
If someone were looking for a similar solution today, they can request access to integrate Twilio with the Facebook Messenger API here.
If you send an SMS with Twilio, for example:
https://www.twilio.com/docs/api/rest/sending-messages
https://www.twilio.com/docs/api/rest/sending-messages
from twilio.rest import TwilioRestClient
# put your own credentials here
ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
AUTH_TOKEN = "[AuthToken]"
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(
to="+15558675309",
from_="+15017250604",
body="Hey Jenny! Good luck on the bar exam!",
media_url="http://farm2.static.flickr.com/1075/1404618563_3ed9a44a3a.jpg",
)
You would then be able to integrate with Facebook Messenger with little change to your Twilio code.
You can try Nimrod : https://www.nimrod-messenger.io/
Your friends will have to register and give you their API keys if you want to send messages to them.

How do you post a link to user's inbox in Facebook?

I am a iPhone application developer. I don't know how to send an "link" to a selected user's inbox in Facebook from my Facebook account.
You can't send messages using a Facebook API from the backend, but you can do through JS SDK or redirecting user to facebook url as per this link
FYI: Send Message
I don't exactly know if I understood your question, but: If you want to provide a link that a user follows in order to go to her/his Facebook inbox, you can use the URL scheme fb://mailbox (provided that she/he has the Facebook app installed)
As #Venu wrote, the api does not allow apps to send messages on the behalf of the user, only with the Send Dialog which you should be able to open using the iOS sdk Dialog.
Another approach you can use is the Chat API with which you can send messages on the behalf of the user, it requires the xmpp_login permission and you to implement an xmpp client.

how to send facebook Notification or message via its api?

please let me know how can i Send facebook Notification or message via its API through a facebook app?
You can use the Old REST API to send notifications to users who have authenticated your application. First you must request the "email" extended permission from the user, then you can use the notifications.sendEmail method to send them the notification.
I used this dialog to send message one my one. But had no luck to send message to facebook account successfully.
https://www.facebook.com/dialog/send?app_id=MY_APP_ID&name=Check This Website&to=MY_APPLICATIONS_USER_ID&link=MY_WEBSITE_LINK&redirect_uri=MY_APPLICATION_URL