Question


Knowledge Expert
FR
Last activity: 2 Aug 2018 4:49 EDT
Hide Pega Chat button when no agents are logged
Hi,
If no agents are logged we'd rather not show the Chat button on our customer site than to show it and then display the unavailable agents message to the client. Is that possible?
Thanks,
Duarte
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution


Knowledge Expert
FR
Hi,
After some investigation I've found out that the best way is to use the REST API : "/api/chat/waitTime/company/COMPANY_TOKEN/queue/QUEUE_NAME". If the method "waitTime" returns a negative value then there are no agents available. Having this parameter received on the customer web site allows us to customize it and hide the chat button when desired.
Example:
URL : https://chat.usefirefly.com/api/chat/waitTime/company/aaaaaaaaaaaaa/queue/Liability
Response: {"waitTime":-1}
Regards,
Duarte


Pegasystems Inc.
FR
Hello,
Well I guess you could try to retrieve a list of running requestor on all nodes and check if you have any starting with an "H".
I never tried that myself but it should be working.


Knowledge Expert
FR
I must confess I didn't understand your answer...Could you please detail?
-
John Christopher Revano


Pegasystems Inc.
FR
Hello,
When you look into the requestors list running on your system (System --> Operations --> Requestor Management), only the ones starting with an "H" will be real agents working, so I think you can test it like that but we may have other options as well.


Pegasystems Inc.
FR
Sorry picture not attached


Knowledge Expert
FR
Would the information that no agents are logged be available from the Chat API? As we are trying to hide the Chat button from the customer site it would be useful to find a way to get this info straight from that page.
-
phani deepika Achref Mabrouk Daigo Muto
Accepted Solution


Knowledge Expert
FR
Hi,
After some investigation I've found out that the best way is to use the REST API : "/api/chat/waitTime/company/COMPANY_TOKEN/queue/QUEUE_NAME". If the method "waitTime" returns a negative value then there are no agents available. Having this parameter received on the customer web site allows us to customize it and hide the chat button when desired.
Example:
URL : https://chat.usefirefly.com/api/chat/waitTime/company/aaaaaaaaaaaaa/queue/Liability
Response: {"waitTime":-1}
Regards,
Duarte