What Facebook Graph API event handles the "Get Started" button? - facebook-graph-api

I'm working on a bot using the Facebook Graph API version 2.6. I need to have the bot message the user when they click the "Get Started" button in Messenger. What messaging API event handles this? I've tried optin with no success. I'm also unable to find a list of these events anywhere except in code for other bots. Any help would be appreciated!

You can define the payload and update the thread settings using the API metioned in the following url:
https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button

Related

AWS Lex and Facebook Messenger Integration Not Working

I'm banging my head against the wall trying to get an AWS Lex based chatbot integrated with Facebook.
As far as I can tell, everything is set up correctly.
When I send a message to my page in Facebook, I don't get a reply. However, the analytics in my app shows that the app is getting messages, so I know the message is making it from the page to the app.
When I try to hit the AWS Lex Webhook directly using POSTMAN, the webhook responds to literally everything I sent to it with a blank HTTP 200 OK response.
The lambda function that is tied to the AWS Lex chatbot is not getting invoked as a result of the messages from Facebook because no logs are getting generated and cloudwatch doesn't show an attempts to run the lambda function.
Does anyone have any ideas?
UPDATE : I ended up engineering around this by bypassing the Facebook channel capability inside AWS Lex and using Lambda instead. I deployed a passthrough API which calls a lambda function and then interacts with AWS Lex via Boto3/Python. In theory this is all supposed to be taken care of from inside AWS Lex with the Facebook channel integration, but I wasn't able to get it to work so I just built around it.
Verify Amazon lex is properly configured with facebook messenger .
Check : Page access token
Verification token
App ID
Check if your webhook is subscribed to page you are messaging on.
Check if your facebook user is added as tester/admin/developer
Check if your latest version of BOt is published on intended alias.
Also while configuring webhook tick necessary options : messages, messaging_postbacks, messaging_optins, message_deliveries, message_reads, messaging_payments
This should resolve your head ache. If not please reply

Facebook webhook does not trigger via native app

I have configured the Facebook Webhook of my app, that it sends a call when a change has happened on my (user)feed. When I post something on Facebook via my laptop or mobile browser, the Webhook triggers.
But when I post something via the native iOS app, it doesn't trigger.
Does anyone have an idea about this?

notification from app request Facebook not received

Im making an application on Phonegap, and therefore using javascript. I have added the facebook plugin, and everything seems to work fine. The user can log in and make app requests to friends using the FB.ui:
FB.ui({method: 'apprequests',
message: 'Try this application, and get ready to Guess This Sound!'
}, requestCallback);
The dialog pop up, and when I send an invitation my requestCallback method return OK
function requestCallback(response){
alert("response " + response);
}
However, my friends do not receive any notification about the request. My application is no longer i sandbox mode, and I can't figure out whats the problem is. Since Im using phonegap, I have added ios and android platform on facebook, and I guess no canvas URL is needed.
UPDATE
Some users do now receive the notifications from the application, but not everyone.However, when my friend clicks on the notification he receive this message: "The requested page can not be viewed right now. It could be temporary unavailable." Is it because my application is not available on google play and app store for the moment?
You have to Add app in your developer account
facebook -> Apps -> "You app" -> Setting -> add platform -> App on Facebook -> Add any URl
Now you will get app request notification
The problem was due to wrong set up in facebook developer API. The error still remains, but is because the app is not released yet. To see the solution to this, see:
Facebook invite request error android

facebook realtime updates not working

I've configured my app to "listen" on events on the user object - changes in the name of the user.
Also, I've configured it to "listen" on events on the permissions object - changes in the permissions of a user.
I succeeded to subscribe successful - it is verified.
So the GET operation works good , however the POST operation doesn't seem to work.
Notice that I was able to work with my callback server with GET and POST successfuly, but it seems that Facebook real time updates doesn't work.
Anyone else experiencing this issue? are there any special points on configuring the callback server?
I've found several remarks on this issue, but I still can't understand if the updates aren't working because of my mistakes or because Facebook updates doesn't work.
For example, this link describes the same issue:
Not receiving realtime updates at all from Facebook
Also, there is an open bug on this issue, reported here: but again I'm not sure if it is my bad:
http://developers.facebook.com/bugs/267220196722379?browse=search_501c8eb30d8239e58192973
It appears that it was problem at my side.
I'm working with a RESTful WCF as the callback server and I had some difficulties with the application/json content type.
I actually got the messages from Facebook server but the WCF rejected the requests because of the application/json content type issue.
So nothing is wrong with Facebook updates.

How to read inbox of Facebook pages using Graph API

Hi I'm developing management system for Facebook pages.
All Facebook pages are changed to sytle of timeline by the end of March, they will come to receive message from users.
So I want to add to read inbox of Facebook page, but I can't find how to read it by Graph API. ("/inbox" method is not worked with page access token.)
Please let me know how to do if you know.
Thanks,
Ogawa
I have suffered alot to find the correct url. It is totally different url compare to Profile messaging.
You can read the messages for a page by issuing an HTTP GET request to http://graph.facebook.com/PAGE_ID/conversations with a Page Access Token and read_mailbox permission.
Surprisingly you can reply for page messages also.
You can reply to a user's message by issuing an HTTP POST to http://graph.facebook.com/CONVERSATION_ID/messages
Note that a page can only reply to a user's message. It cannot initiate a private message with a user. Also, a page can respond not more than twice to a user's message before the user has replied back.
Hope that helps.
Graph api explore use this script after authenticating user, permission required
permission script:
$loginUrl = $facebook->getLoginUrl(array(
'scope'=>'email,read_mailbox,read_requests',
));
READ INBOX:
<?php
$user_mail=$facebook->api('/me?fields=id,name,inbox.limit(10)');
echo'<pre>',print_r($user_mail),'</pre>';
?>