Facebook Webhook Leads - callback url 404 - facebook

Im trying to setup and webhook for facebook leads, i've followed the tutorial that is given. Everything works fine and all the verification steps through the Graph explorer are "OK". My endpoints seams to live and working.
But when i try the Lead Ads Testing Tool and make an request to send the form i get the status "404 rejected"
I have verified that the callback url is correct, both via the Graph explorer and the webinterface on developer.facebook.com under the tab "Webhooks"
I have logs on the server so i can see all types of requests done to the url, empty or not and i don't even get an request. I've tried to rule out every possible "auth" problems.
So i'm stuck guys, what is missing? What i'am doing wrong?

Related

HTTP Response 503, however site works

At this moment I'm working with the Facebook API; I Need to fill in a Privacy Policy, so I did. However, after some research I discovered that the HTTP Response code will always be 503, But I can't find out why. The page is there, and when visiting it in a Browser it works, with no problem at all. Running a check, shows me that the page returns a 503 to facebook and any other request (For example. https://httpstatus.io/).
I use cloudflare, nothing more. Why am I getting a 503 Response, but the page is just working fine?
It is possible to have 503 only when robot is visiting the page. Try to simulate Facebook User Agent from your browser or rest client.
You can check Facebook user agents on developers facebook page:
https://developers.facebook.com/docs/sharing/webmasters/crawler
Cloudflare could be the cause of your problem, because it blocks bad robots (Facebook should be good robot). Try to disable it and see if it works. If this is the problem, you need to contact Cloudflare support.

"The client ID is missing or invalid" in OAuth request

I'm trying to set up OAuth2 flow between my application and Smartsheet, using the instructions at http://smartsheet-platform.github.io/api-docs/?shell#oauth-flow.
It seems as if the client_id parameter is being lost when the user submits Smartsheet's authorization dialog. Here's what I'm seeing:
My web page displays a link to https://app.smartsheet.com/b/authorize?response_type=code&client_id=[my_client_id]&scope=READ_SHEETS%20WRITE_SHEETS%20SHARE_SHEETS
(From here on, I will be omitting the protocol and domain from URLs, as I have posted little enough to Stack Overflow that I am unable to include more than two links in a question!)
I click that link, and wind up on /b/authorize?formName=fn_authorize&formAction=fa_loadAuthorize&response_type=code&client_id=[my_client_id]&scope=READ_SHEETS+WRITE_SHEETS+SHARE_SHEETS . The dialog shows the logo and name of my web site, so I know that the client_id is correct.
Then I click "Allow" and see the message "The client ID is missing or invalid" at /b/authorize?formName=fn_authorize&formAction=fa_loadAuthorize&redirect_uri=[my redirect uri]
I've gone over the instructions a couple of times to make sure the URI I'm generating is valid, and have tried it with and without the redirect_uri parameter.
What might I be doing wrong?
I'm unable to reproduce the issue you've described, even using the oAuth URL copied exactly from your post/question. Here's a recap of my test scenario:
Created new "App" (via Developer Tools in the Smartsheet UI) to generate a client id and app secret.
Redirected user to: https://app.smartsheet.com/b/authorize?response_type=code&client_id=[my_client_id]&scope=READ_SHEETS%20WRITE_SHEETS%20SHARE_SHEETS
User clicks Allow.
User is successfully redirected to the redirect URL that's specified in my App config settings.
So, Smartsheet oAuth appears to be functioning successfully. Which would seem to suggest that perhaps it's something specific to your App config settings that's causing your issue. A couple of suggestions for troubleshooting:
Try editing your App config settings to (temporarily) replace the value of App redirect URL with something simple like: http://www.google.com -- then test oAuth flow again. If it works with the new redirect URL, that'd suggest an issue with Smartsheet not being able to redirect to your original redirect URL (and the "client id is missing or invalid" error message is not really an accurate message).
If changing the redirect URL doesn't resolve the error -- perhaps try creating a new App altogether (via Developer Tools in the Smartsheet UI), and attempt the same oAuth flow using that new App's client id. If for some reason there's something corrupt about the App that's giving you the error now, then it's possible that starting over with a new App altogether will resolve your issue.

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.

Importing Gmail contacts with Oauth 2 stopped working

On my site I ran some PHP scripts that imported Gmail contacts using Oauth 2, a few months ago it stopped working without me changing anything. Something must have changed with Google API and/or policy, can someone help me identify the problem ?
The initial url request looks like this (replaced my domain with example.com):
https://accounts.google.com/o/oauth2/auth?scope=https://www.google.com/m8/feeds&state=whatever&redirect_uri=http://www.example.com/import/gmail-callback&response_type=token&client_id=293090831245.apps.googleusercontent.com&approval_prompt=force
That prompts the user to accept/decline access to their data (looks good), once user accepts, it is redirected back to my site, here I make a request to get user's contacts based on the received token:
file_get_contents("https://www.google.com/m8/feeds/contacts/default/full?access_token=".$_GET['access_token']."&alt=json&v=3.0&updated-min=2004-03-16T00:00:00&max-results=3000");
But Google now replies with
HTTP request failed! HTTP/1.0 403 Forbidden
Any tips ?
I found the answer, some changes in Google Developer's console set the contacts API to OFF by default.
It worked after I logged to developer console and enabled contacts API:

Cakephp 2.4.5, classic Auth seem block opengraph request

I was using classic Auth without any problem while I want to put some social button.
With Facebook or G+ button, I see no image on the share card create by the button... after some inspection, I realized CakePHP seems to block opengraph requests.
Open Graph Object Debugger says "error 200" and I suppose the cakephp Auth component blocked it.
But, in my first controlleur, every action are granted ($this->Auth->allow();) but nothing change....
How can I authorize Opengraph requests with the cakephp Auth component?
In fact, the problem was cause by the Gzip compression used by the server.
Disable this feature (with .htaccess) resolve the problem...