Newer Version Available
getServicePresenceStatusChannels for Lightning Experience
Retrieves the service channels that are associated with an Omni-Channel user’s
current presence status.
Arguments
| Name | Type | Description |
|---|---|---|
| callback | function | JavaScript method to call when the channels associated with a presence status are retrieved. |
Sample Code
Component code:
1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2 <lightning:omniToolkitAPI aura:id="omniToolkit" />
3 <lightning:button label="Get Status Channels" onClick="{! c.getStatusChannels }" />
4</aura:component>Controller code:
1({
2 getStatusChannels: function(cmp, evt, hlp) {
3 var omniAPI = cmp.find("omniToolkit");
4 omniAPI.getServicePresenceStatusChannels({
5 callback: function(result) {
6 if (result.success) {
7 console.log('Retrieved Service Presence Status Channels successfully');
8 var channels = JSON.parse(result.channels);
9 //For example purposes, just retrieve the first channel
10 console.log('First channel ID is: ' + channels[0].channelId);
11 console.log('First channel developer name is: ' + channels[0].developerName);
12 } else {
13 console.log('Get Service Presence Status Channels failed');
14 }
15 }
16 });
17 }
18})