Difference between revisions of "ATC/Current/SDK/Use Events methods with web chats"
From Genesys Documentation
m (Text replacement - "\|Platforms?=([^\|]*)PureCloud([\|]*)" to "|Platform=$1GenesysCloud$2") |
m (Text replacement - "\|Platform=([^\|]*)GenesysEngage-onpremises([\|]*)" to "|Platform=$1GenesysEngage-cloud$2") |
||
Line 6: | Line 6: | ||
|Dimension=WebActions | |Dimension=WebActions | ||
|ComingSoon=No | |ComingSoon=No | ||
− | |Platform=GenesysEngage- | + | |Platform=GenesysEngage-cloud, PureConnect, GenesysCloud |
|Prereq= | |Prereq= | ||
|Section={{Section | |Section={{Section |
Revision as of 02:33, July 25, 2020
This topic is part of the manual Journey JavaScript SDK for version Current of Genesys Predictive Engagement.
Contents
- 1 Subscribe to offered events
- 2 Subscribe to accepted events
- 3 Subscribe to started events
- 4 Subscribe to engaged events
- 5 Subscribe to rejected events
- 6 Subscribe to ignored events
- 7 Subscribe to errored events
- 8 Subscribe to timedout events
- 9 Subscribe to all web chat events
- 10 Unsubscribe from web chats in the offered state
See examples of how to use Events methods with web chats.
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!