S
S
SANYAAAASSSS2018-06-28 15:57:24
Facebook
SANYAAAASSSS, 2018-06-28 15:57:24

Working with facebook webhook, how to set up?

With a new comment, you need to get information about the comment. Does anyone have any examples? Please link to office. do not post documentation.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Nemiro, 2018-06-28
@SANYAAAASSSS

  1. We open the page https://developers.facebook.com/apps/ and create or use an existing application.
  2. In the callback page code, we process the GET parameters hub.mode , hub.challenge and hub.verify_token . We check that the value of hub.verify_token matches the value specified when adding the callback address in the Webhooks settings on the Facebook site and if the value is correct, we return the value of hub.challenge ( HTTP200 , text/plain ) so that Facebook can use this address.
    if (isset($_GET['hub.verify_token']) && $_GET['hub.verify_token'] == '123') {
      header('Content-Type: text/plain');
      echo $_GET['hub.challenge'];
    }

P
polekhin, 2020-11-11
@polekhin

The name of the parameters is now different:
[hub_mode] => subscribe
[hub_challenge] => 1698542890 [
hub_verify_token] => 123 ; echo $query['hub_challenge']; die; // otherwise it will return json, which fb will not accept

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question