Error while making a subscription on webhooks on facebook app developer platform - facebook

I am not able to make webhooks new page subscription its giving me an error in the callback url saying "(The URL couldn't be validated. Response does not match challenge, expected value = '736926330', received=')", i am not having a domain name as same as my app name.

You need a server the supports https and script code running on it to authenticate the subscription.
Facebook Messenger Platform Developers Complete Guide

Related

Issue creating app requests on facebook http graph api

When trying to create app requests through facbeook http graph api I'm getting the error "(#2) Failed to create any app request".
As described in the documentation (https://developers.facebook.com/docs/graph-api/reference/user/apprequests/) I'm using the URL https://graph.facebook.com/{userid}/apprequests setting in post the access token, a title and a message. I've tried different combinations of parameters just to check if I needed anything else, but just if I remove access token and/or title I get different errors.
In addition to that, if I use my own userid, instead of other userid (obviously a friend) that I want to send the request to, there's no error at all, but no request is created.
I don't think it may be related with permissions because both users (source and destination of the request) are admin, developer or tester of the app.
Thank you
Just in case anyone needs it, the problem is that user apprequests can only be created if using any facebook ui methods. That's why in this thread Apprequest of Android Facebook sdk 3.0 comment 1 advices to use webdialog instead of sending the request in code.
More on this topic, I've been researching and I found out that I started with my app really long ago (using API lower than 2.3) so I didn't need to set the category as "game" to be able to send apprequests. I updated its category and after multiple tests I've found the following scenarios:
Javascript API works correctly to send requests in my app
Graph API fails to send requests if using user auth token getting the same error as before
Graph API is able to send requests if using app auth token (from app_id + app_secret)
As far as I've read, there's no limitation in using either kind of auth tokens for apprequest calls.
In addition, my app will be running in web, desktop and mobile. The scenario in which I'm using graph API directly is desktop for obvious reasons (there's other APIs tor the other platforms). As recommended in the FB api documentation, the app secret should not be included in binary code deployed to users, so I would need to use the user auth token.
Any help would be apreciated
Thanks

Facebook messenger callback

There are questions related to fb messenger. but as none answers my question, here it is.
I have been given a developer account for API to work on which is 'http'. Meaning I won't be able to use it as Callback URL. I am not authorized to request developer for https too.
How should I proceed?
Facebook requires that the callback url for receiving events use HTTPS as the scheme and specify a verify token in the app's webhook section.You should try to get the server you are working with to install the necessary SSL certificate(s) and update your webhook to point at it.
Facebook requires https. You can use ngrok to convert your local URLs to https based public URL and use them on webhook subscription url.

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 API only working when I'm logged in with developer account

I need to use the Facebook JS API to post to the users feed. A working example of what I wish to achieve is here: http://jsbin.com/utowek/2/edit?html,css,output
When I copy the code from the link above and use it on my server with my APP ID it works fine when I'm logged in to facebook with my developer account, but fails when I am not logged in or are logged in with a different account. When it fails I get the message: 'An error occurred. Please try again later.'
In the app settings the Site URL is set to the html page on my server and the domain is set to my domain ending .co.uk

Invalid URL error message for integrating FB Apps into website with user using static IP

I'm living in Vietnam now. As I known and tested, FB is blocked now. Therefore I have to use static IP for facebook (60.254.175.42). Using this method, I can log into Facebook from WEB browser without any problem. But when I use OAuth protocol to integrate FB into my website (ex. allows user use FB account to log into my website), I always receive the message 'The requested URL "/oauth/authorize?client_id=152190004803645&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8888%2Ffb&scope=publish_stream,email,user_birthday,user_location", is invalid.
Reference #9.26affe3c.1328519733.956d48'.
Please advice,
Thanks
Ensure that you using full URL and no just part of it before redirecting user, full URL should look like this:
http://www.facebook.com/dialog/oauth/authorize?client_id=152190004803645&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8888%2Ffb&scope=publish_stream,email,user_birthday,user_location
Also check that you defined localhost as App Domain in your application settings.