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

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'];
       return;
   } else {
       echo 'Invalid Verify Token';
       return;
   }
}
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.
Reply


Messages In This Thread
Facebook Webhooks API - by tan87 - 05-11-2017, 09:41 PM
RE: Facebook Webhooks API - by Martin7483 - 05-12-2017, 12:21 AM
RE: Facebook Webhooks API - by tan87 - 05-12-2017, 08:32 AM
RE: Facebook Webhooks API - by antony - 05-12-2017, 09:11 AM
RE: Facebook Webhooks API - by tan87 - 05-14-2017, 02:18 AM
RE: Facebook Webhooks API - by InsiteFX - 05-14-2017, 02:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB