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
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'])) {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.
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 )
|
Welcome Guest, Not a member yet? Register Sign In |