Welcome Guest, Not a member yet? Register   Sign In
Facebook Webhooks API

Not sure whether you guys can help me out here.

I have worked on CI for other project and it is working perfectly fine.

However, when I am trying to use CI for one of my Facebook Webhooks projects, it seems that CI is filtering the data posted from Facebook but if i create a standalone PHP file using the same code (except the GET/POST function which using CI $this->input), it is working fine.

When I enable CI debug mode, this is the debug log available:
DEBUG - 2017-05-12 02:18:51 --> Global POST, GET and COOKIE data sanitized

I have checked the HTTP log as well, HTTP 403 is returned for all Facebook post to CI.

I would really like to use CI for all my project. Hope someone out there will have some idea

Is CSRF protection enabled?

Does not seems to work too as I disable it.

Could you provide an example of what you're trying to achieve, and how you tried doing it in CI?

Thanks antony.

Ok, when performing Facebook verification, FB send a GET request to CI and it is working fine for the verification part.

Quote:if (isset($_GET['hub_verify_token'])) {
   if ($_GET['hub_verify_token'] === 'lgC5XeJwYCJgaMfdTzit') {
       echo $_GET['hub_challenge'];
   } else {
       echo 'Invalid Verify Token';
However, when FB do a postback for data , it is posting via POST which we need to extract it using this code. This code is inside the controller.
$input = json_decode(file_get_contents('php://input'), true);

However, CI response 403. No matter what I do.

(This post was last modified: 05-14-2017, 02:55 AM by InsiteFX.)

Do you by any chance have xss_clean turned on?

I checked the input core and it does nothing to the input stream unless you have xss_clean turned on.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Theme © iAndrew 2016 - Forum software by © MyBB