Webhooks

Webhooks are a cool way to deliver the data to other applications immediately.

It is very useful to share the data in a real time environment.

There are different types of webhooks available.

Webhooks:

This option notifies the activity that is happening on your chat. The chat data will be sent to the client’s URL which he/she provides.

To utilize this option,

  1. Go to Settings tab.
  2. Click on Advanced Setup.
  3. Click on Webhooks.
  4. Select +ADD NEW.
  5. Choose the Action and Data you need from Chatrify.
  6. Enter the URL where Data will be send when selected Action is triggered
  7. Save the changes.

webshooks

 Example:
1) Show notification in your internal dashboard when new chat starts
>> First you have to add new webhook, in Action select Chat Starts, select what Data you want & enter the url of your application where you will receive the Data once Action is triggered. Below is the sample php code for webhook.

<?php
//Sample php code to read the data sent by Chatrify webhook.
$output = file_get_contents('php://input');
$output = json_decode($output);

There are total three events "chat_started", "chat_ended" & "visitor_queued"
if ($output->event_type === 'chat_started')
{
  //Show notification or do something....
}

Each webhook has following properties:
Action – determines when the webhook is sent to your web server.
Data – includes additional information in the webhook.
URL – address of your web server the webhook will be sent to.

There are total three action types "chat_started", "chat_ended" & "visitor_queued". 
"chat_started" action supports chat, visitor & pre-chat form data. 
"chat_ended" action supports chat, visitor & pre-chat form data.
"visitor_queued" action supports visitor & pre-chat form data.