Pingtochat Docs

Pingtochat Docs

Did You Know?

Advanced visual search system powered by Ajax

leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

Webhook

Estimated reading: 1 minute 101 views

Pingtochat supports webhooks that can alert you of the following via callback URLs.

  • Messages received
  • Messages sent (Template & Session)
  • Status of the messages sent (Sent/Delivered/read)

How to add a Webhook to Pingtochat?

  • Navigate to:Settings ->API ->Webhook.
This image has an empty alt attribute; its file name is Screenshot-from-2024-12-24-17-39-04.png
  • Create an HTML URL for the webhook.
  • Enter your Hub Verification Token in the designated field on the webhook form.
  • When an event occurs, we will send the hub verify token along with the hub challenge to the provided URL.
  • For verification, the customer must return the same hub challenge to confirm receipt.

This ensures successful integration and validation of webhook events.

Example :

<?php

$input = file_get_contents('php://input');
$hub_challenge  = json_decode($input)->hub_challenge;
$verify_token  = json_decode($input)->hub_verify_token;
$expected_token = '123';

if ($verify_token === $expected_token) {
   
    http_response_code(200);
    echo $hub_challenge;
    exit;
}

http_response_code(400);
echo json_encode(["message" => "Bad request!"]);
?>

Leave a Comment

Share this Doc

Webhook

Or copy link

CONTENTS