Streaming API - Eventing API (Webhooks)
Is there a way for LiveHelpNow to push customer data such as Name, Email, Chat transcript, Offline message, etc. to my contact management system automatically, in realtime?
- Login to your account and go to Admin Panel->Integrations & Partners -> Webhooks
- Click on "Add Event"
- Select Event, Event Type, Verb, Headers (optional), Construct your payload by clicking on available tokens for the event.
Provide URL to submit the data to.
* We highly recommend to enable "Test" mode for the event and test the event first. While in test mode, the Event will email you the PayLoad so you can see whether the format is what you expected and then switch Event to live mode by unchecking "Test" mode and have the data sent to your "Live" URL for processing.
<?php
// To access your headers being sent
$headers = array();
foreach($_SERVER as $headerName => $headerValue){
if(substr($headerName, 0, 5) == "HTTP_"){ // This will eliminate no request headers
array_push($headers, array($headerName, $headerValue));
}
}
// The $headers variable will now contain all HTTP Request headers within a multidimensional array
// The variable below with get the payload from the LiveHelpNow Eventing API
$payload = $HTTP_RAW_POST_DATA;
?>
Private Function RequestInputStreamToString(oStream As System.IO.Stream) As String
Dim sb As New System.Text.StringBuilder()
Dim streamLength As Integer
Dim streamRead As Integer
streamLength = Convert.ToInt32(oStream.Length)
Dim streamArray As [Byte]() = New [Byte](streamLength - 1) {}
streamRead = oStream.Read(streamArray, 0, streamLength)
For i As Integer = 0 To streamLength - 1
sb.Append(Convert.ToChar(streamArray(i)))
Next
Return sb.ToString()
End Function
Response.Write(RequestInputStreamToString(Request.InputStream))
private string RequestInputStreamToString(System.IO.Stream oStream)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
int streamLength = 0;
int streamRead = 0;
streamLength = Convert.ToInt32(oStream.Length);
Byte[] streamArray = new Byte[streamLength];
streamRead = oStream.Read(streamArray, 0, streamLength);
for (int i = 0; i <= streamLength - 1; i++) {
sb.Append(Convert.ToChar(streamArray[i]));
}
return sb.ToString();
}
Response.Write(RequestInputStreamToString(Request.InputStream))
Chat Opened | Chat Assigned | Chat Closed |
Customer Data Country Custom info feed (value 1) Custom info feed (value 2) Custom info feed (value 3) Customer language Date of last visit, if any Department ID Host Name IP Address ISP Company Name Keywords used if referrer is a search engine Number of pages visited Operator notes Referrer URL Visitor current page Visitor entry page Visitor ID Visitor referral source Browser Data Chat Data
|
Customer Data Country Custom info feed (value 1) Custom info feed (value 2) Custom info feed (value 3) Customer language Date of last visit, if any Department ID Host Name IP Address ISP Company Name Keywords used if referrer is a search engine Number of pages visited Operator notes Referrer URL Visitor current page Visitor entry page Visitor ID Visitor referral source Browser Data Chat Data
|
Customer Data Country Custom info feed (value 1) Custom info feed (value 2) Custom info feed (value 3) Customer language Date of last visit, if any Department ID Host Name IP Address ISP Company Name Keywords used if referrer is a search engine Number of pages visited Operator notes Referrer URL Visitor current page Visitor entry page Visitor ID Visitor referral source Browser Data Chat Data |