Question
Capgemini
SE
Last activity: 6 Apr 2017 9:48 EDT
Initiate PegaChat through hyperlink
Hi, I have a requirement that we have to initiate a chat on clicking a hyperlink on a picture box containing CSR happy faces while talking to a customer. The script that Pega provided it creates a chat icon at the buttom of the page and business does not want this. How we will configure or what is needed to configure so that we can have a hyperlink and chat can be initiated from that hyperlink.
***Updated by Moderator: Marissa to update categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
Whatever webpage that needs to include the button also needs to include the Chat snippet .. something like this ..
<html lang="en">
<head>
<title>Chat Launch Page</title>
<script type="text/javascript">
<Chat snippet that came from the company signup>
</script >
</head>
<body>
<button type="button" onclick="fireflyChatAPI.startChatSession()">Start Chat</button>
</body>
</html>
This code will still show the standard Chat launcher button. If you want to hide it, find the div ID and hide it using CSS.
Pegasystems Inc.
US
Hello,
I assume that the icon ultimately make some sort of call to the server. Can you make your link do the same thing? I don't know if you need iFrames or something initialized so that you have a target for the chat to take place, so it may not be quite as simple as I suggest, but you should be able to figure that out with a bit of poking. And hopefully most of the OOTB code can be leveraged if all you're looking for is to display the icon as an anchor.
Thanks,
Mike
Pegasystems Inc.
US
Mike, I've asked the Pega Chat team to reply to this message. That icon relies on React JS library, so they won't be able to see and copy the actions. There are APIs available to start chats programatically, I'm just not sure about the level of documentation that accompanies it.
Thanks
Capgemini
SE
Please let me know if we have any document regarding pegaCHAT API. It will be very helpful.
Pegasystems Inc.
US
Example:
Example:
//start a chat session when the user clicks on the window
fireflyChatAPI.ready(function() {
window.on('click', function(e) {
fireflyChatAPI.startChatSession();
});
});
Thanks,
Scott
Capgemini
SE
Hi Scott
If I want to call a function onclick of a button or hyperlink which will initiate a chat how will i do it? Where will set token, type, serverhosturl etc.
Accepted Solution
Pegasystems Inc.
US
Whatever webpage that needs to include the button also needs to include the Chat snippet .. something like this ..
<html lang="en">
<head>
<title>Chat Launch Page</title>
<script type="text/javascript">
<Chat snippet that came from the company signup>
</script >
</head>
<body>
<button type="button" onclick="fireflyChatAPI.startChatSession()">Start Chat</button>
</body>
</html>
This code will still show the standard Chat launcher button. If you want to hide it, find the div ID and hide it using CSS.
Capgemini
SE
Thanks Amit, it did work!! But in the default launcher we cannot initiate a chat when no user is available online, but when I click on start button it is always initiating a chat with pre chat questions and ultimately ending up saying "No user is available online" which is annoying to business. Do we have any API which will tell if there is any user online so that we can disable or hide the button when csr is unavailable in chat.
Pegasystems Inc.
IN
Hello!
I believe the question on online users has been asked on another of your posts and it has got a response: PegaChat API to tell if there is any online user
I hope you have gotten a chance to check that! We recommend that you pursue discussion on the other post since the original question on this post has been Answered and there's new line of discussion opened up by you!
Thank you,
Capgemini
SE
Thanks Lochan
Pegasystems Inc.
US
The source of the confusion here is between the term user and agent. When you say user, I think of the end user who is accessing the company's webpage and would like to chat with someone. Agent is someone who is logged into a queue and is able to provide the said help. There's no API provided by Pega to know how many users are on the page at a given time. As far as how many agents are logged in, the other thread provided that API.
thanks