Newer Version Available

This content describes an older version of this product. View Latest

getServicePresenceStatusChannels

Retrieves the service channels that are associated with an Omni-Channel user’s current presence status. Available in API versions 32.0 and later.

Syntax

1sforce.console.presence.getServicePresenceStatusChannels(callback:function)

Arguments

Name Type Description
callback function JavaScript method to call when the channels associated with a presence status are retrieved.

Sample Code–Visualforce

1<apex:page>
2    <apex:includeScript value="/support/console/61.0/integration.js"/>
3    <a href="#" onClick="testGetChannels();return false;">
4        Get Channels Associated with a Presence Status
5    </a>
6
7    <script type="text/javascript">
8        function testGetChannels() {
9            //These values are for example purposes only.
10            sforce.console.presence.getServicePresenceStatusChannels(function(result) {
11                if (result.success) {
12                    alert('Retrieved Service Presence Status Channels successfully');
13                    var channels = JSON.parse(result.channels);
14                    //For example purposes, just retrieve the first channel
15                    alert('First channel ID is: ' + channels[0].channelId);
16                    alert('First channel developer name is: ' + channels[0].developerName);
17                } else {
18                    alert('Get Service Presence Status Channels failed');
19                }
20            });
21        }
22    </script>
23</apex:page>

Response

This method is asynchronous so it returns its response in an object in a callback method. The response object contains the following properties:

Name Type Description
success Boolean true if retrieving the current presence status channels was successful; false if the retrieving the current presence status channels wasn’t successful.
channels JSON string of channel objects Returns the IDs and API names of the channels associated with the presence status.