0

Supposing we have a client-server architecture where the client is using javascript Live Agent APIs and the server is Salesforce, is it possible for the client to send arbitrary data in realtime towards the server and link those data to the current chat session after the chat has started?

For example, something like this timeline:

  • chat with operator starts
  • the user clicks button "A" so variable "button A pressed" is passed to the server (user is still chatting)
  • the user clicks button "B" so variable "button B pressed" is passed to the server (user is still chatting)

And so on.

Thanks

Gabriele

  • I may be able to help, but I'm a bit unclear on what you're asking. Can you provide more details on what it is you're trying to accomplish? – AndyLintner Apr 10 '15 at 16:16
  • I've integrated my question with a real use case, hope this makes it clearer. – Gabriele D'Antona Apr 10 '15 at 17:54
1

It sounds like you want the custom event API. It's documented as part of the service cloud console integration toolkit: http://www.salesforce.com/us/developer/docs/api_console/

To publish a custom event from the chat window indicating button A was pressed:

liveagent.chasitor.sendCustomEvent("buttonPress", "A");

In a service cloud console component (you can get chatKey via sforce.console.chat.getDetailsByPrimaryTabId):

sforce.console.chat.onCustomEvent(chatKey, "buttonPress", function(type) {
    alert("Button "+type+" pressed!");
});
| improve this answer | |
  • Thanks. Can I do this externally from the chat window? And also, will those events be related to the chat in any way on the database? – Gabriele D'Antona Apr 14 '15 at 6:09
  • @GabrieleD'Antona Were you able to find a solution to this? I know this is an old thread, I am trying something similar, difference is we do not use button and using the addcustomdetail. I am not sure how can I access those information. – apple123 Mar 2 '17 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.