From Genesys Documentation
Jump to: navigation, search
m (Text replacement - "\|Platforms?=([^\|]*)PureCloud([\|]*)" to "|Platform=$1GenesysCloud$2")
m (Text replacement - "Genesys Cloud" to "Genesys Cloud CX")
 
(4 intermediate revisions by 2 users not shown)
Line 6: Line 6:
 
|Dimension=WebActions
 
|Dimension=WebActions
 
|ComingSoon=No
 
|ComingSoon=No
|Platform=GenesysEngage-onpremises, PureConnect, GenesysCloud
+
|Platform=PureConnect, GenesysCloud, GenesysEngage-cloud
|Prereq=
 
 
|Section={{Section
 
|Section={{Section
 +
|alignment=Vertical
 +
|structuredtext={{NoteFormat|1=This article only applies to customers using {{Link-AnywhereElse|product=ATC|version=Current|manual=AdminGuide|topic=About_web_chats|display text=web chat}}. If you are a Genesys Cloud CX customer, we encourage you to use the new {{Link-AnywhereElse|product=ATC|version=Current|manual=AdminGuide|topic=About_web_messaging|display text=web messaging}} feature to replace web chat.|2=}}<br />
 +
|Status=No
 +
}}{{Section
 
|sectionHeading=Subscribe to offered events
 
|sectionHeading=Subscribe to offered events
 
|anchor=WCOffered
 
|anchor=WCOffered
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<syntaxhighlight lang="javascript">
 
|structuredtext=<syntaxhighlight lang="javascript">
 
ac('on', 'webchat:offered', (event) => {
 
ac('on', 'webchat:offered', (event) => {
Line 19: Line 20:
 
});
 
});
 
</syntaxhighlight>
 
</syntaxhighlight>
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 26: Line 25:
 
|anchor=WCAccepted
 
|anchor=WCAccepted
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<syntaxhighlight lang="javascript">
 
|structuredtext=<syntaxhighlight lang="javascript">
 
ac('on', 'webchat:accepted', (event) => {
 
ac('on', 'webchat:accepted', (event) => {
Line 33: Line 30:
 
});
 
});
 
</syntaxhighlight>
 
</syntaxhighlight>
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 40: Line 35:
 
|anchor=WCStarted
 
|anchor=WCStarted
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<syntaxhighlight lang="javascript">
 
|structuredtext=<syntaxhighlight lang="javascript">
 
ac('on', 'webchat:started', (event) => {
 
ac('on', 'webchat:started', (event) => {
Line 48: Line 41:
 
   
 
   
 
</syntaxhighlight>
 
</syntaxhighlight>
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 55: Line 46:
 
|anchor=WCEngaged
 
|anchor=WCEngaged
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<syntaxhighlight lang="javascript">
 
|structuredtext=<syntaxhighlight lang="javascript">
 
ac('on', 'webchat:engaged', (event) => {
 
ac('on', 'webchat:engaged', (event) => {
Line 62: Line 51:
 
});
 
});
 
</syntaxhighlight>
 
</syntaxhighlight>
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 69: Line 56:
 
|anchor=WCRejected
 
|anchor=WCRejected
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<syntaxhighlight lang="javascript">
 
|structuredtext=<syntaxhighlight lang="javascript">
 
ac('on', 'webchat:rejected', (event) => {
 
ac('on', 'webchat:rejected', (event) => {
Line 76: Line 61:
 
});
 
});
 
</syntaxhighlight>
 
</syntaxhighlight>
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 83: Line 66:
 
|anchor=WCIgnored
 
|anchor=WCIgnored
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<syntaxhighlight lang="javascript">
 
|structuredtext=<syntaxhighlight lang="javascript">
 
ac('on', 'webchat:ignored', (event) => {
 
ac('on', 'webchat:ignored', (event) => {
Line 90: Line 71:
 
});
 
});
 
</syntaxhighlight>
 
</syntaxhighlight>
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 97: Line 76:
 
|anchor=WCErrored
 
|anchor=WCErrored
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<syntaxhighlight lang="javascript">
 
|structuredtext=<syntaxhighlight lang="javascript">
 
ac('on', 'webchat:errored', (event) => {
 
ac('on', 'webchat:errored', (event) => {
Line 104: Line 81:
 
});
 
});
 
</syntaxhighlight>
 
</syntaxhighlight>
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 111: Line 86:
 
|anchor=WCTimedOut
 
|anchor=WCTimedOut
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<syntaxhighlight lang="javascript">
 
|structuredtext=<syntaxhighlight lang="javascript">
 
ac('on', 'webchat:timedout', (event) => {
 
ac('on', 'webchat:timedout', (event) => {
Line 118: Line 91:
 
});
 
});
 
</syntaxhighlight>
 
</syntaxhighlight>
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 125: Line 96:
 
|anchor=WCAll
 
|anchor=WCAll
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<syntaxhighlight lang="javascript">
 
|structuredtext=<syntaxhighlight lang="javascript">
 
ac('on', 'webchat:all', (event) => {
 
ac('on', 'webchat:all', (event) => {
Line 133: Line 102:
 
   
 
   
 
</syntaxhighlight>
 
</syntaxhighlight>
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 140: Line 107:
 
|anchor=Unsubscribe
 
|anchor=Unsubscribe
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<syntaxhighlight lang="javascript">
 
|structuredtext=<syntaxhighlight lang="javascript">
 
ac('off', 'webchat:offered', eventHandler); // unsubscribes `eventHandler` from 'webchat:offered' events
 
ac('off', 'webchat:offered', eventHandler); // unsubscribes `eventHandler` from 'webchat:offered' events
 
</syntaxhighlight>
 
</syntaxhighlight>
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}
 
}}
 
}}
 
}}

Latest revision as of 21:28, November 9, 2021

Difference between revisions of "ATC/Current/SDK/Use Events methods with web chats"

See examples of how to use Events methods with web chats.

Important
This article only applies to customers using web chat. If you are a Genesys Cloud CX customer, we encourage you to use the new web messaging feature to replace web chat.

Subscribe to offered events

ac('on', 'webchat:offered', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to accepted events

ac('on', 'webchat:accepted', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to started events

ac('on', 'webchat:started', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to engaged events

ac('on', 'webchat:engaged', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to rejected events

ac('on', 'webchat:rejected', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to ignored events

ac('on', 'webchat:ignored', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to errored events

ac('on', 'webchat:errored', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to timedout events

ac('on', 'webchat:timedout', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to all web chat events

ac('on', 'webchat:all', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Unsubscribe from web chats in the offered state

ac('off', 'webchat:offered', eventHandler); // unsubscribes `eventHandler` from 'webchat:offered' events
Comments or questions about this documentation? Contact us for support!