^
^
JavaScript Customer Interaction Services Package

< Back to Package Overview

Tutorials

Team Tutorial

Here is a simple example demonstrating the use of the Team API to retrieve an Array of TeamMembers, and display some properties of each TeamMember returned.


var team = clientSession.createTeam();

team.addOnTeamMembersAddedCallback(function () {

    // Fetch all team members 
    var members = team.getMembers();

    // Clear list of existing team members
    $('#team-view > tbody').html('');

    $.each(members, function(index, member) {
        // Append table row for each team member
        $('#team-view > tbody').append($('<tr>')
            .append('<td>' + member.displayName + '</td>')
            .append('<td>' + member.type + '</td>')
            .append('<td>' + member.address + '</td>'));
    });
});

team.addOnTeamMembersRemovedCallback(function () {
    // Clear list of team members
    $('#team-view > tbody').html('');
});

Supervisor Broadcast

Here is a simple example demonstrating how a Supervisor can broadcast a message to team members. The message will be delivered as an Error notification, with INFO severity. Please note, that a copy will also be delivered to the sending Supervisor.


var data: { userHandles: ['agent001','agent002'], message: '10 dollar discount for the next 10 minutes!' };

team.broadcast(data);

//to receive the message notification
clientSession.addOnErrorCallback(onError);

Feedback

Your feedback has been successfully submitted.

There was a problem submitting your feedback. Please contact your product support representative.

Page Feedback