The NotifyOnTaskClient API provides methods for sending SMS messages or starting/managing a conference call for various telephony service providers, such as Zoom and Webex.

Any UI can consume the NotifyOnTaskClient API by explicitly including the NotifyOnTaskClient UI script.

Using the NotifyOnTaskClient API you can:

  • Start a conference call
  • End a conference call
  • Add participants
  • Perform actions that are available through the telephony driver such as:
    • mute/unmute participants
    • remove participants from a conference call
    • add participants to a conference call
    • start a conference call
    • end a conference call

The Notify (com.snc.notify) plugin requires a separate subscription. For additional information on activating the Notify plugin, see Activate Notify.

NotifyOnTaskClient - addParticipants(Object data)

Adds the specified participants to a specified conference call.

Table 2. Returns
Type Description
Object Results of the conference action.

<action>.status: Status of the conference action.

  • Data type: Boolean
  • Possible values:
    • true: Conference action succeeded
    • false: Conference action failed

<action>.successMessages: If status is true, success message(s), else empty.

  • Data type: Array of Strings

<action>.warnMessages: If status is false, any warning messages thrown during processing.

  • Data type: Array of Strings

<action>.errorMessages: If status is false, any error messages thrown during processing.

  • Data type: Array of Strings

Example

The following code example shows how to call this method.

function addToConferenceCall() {
    var data = NotifyOnTaskClient.getNotifyActionTemplate();
    data.serviceProvider = 'Telephony'; // e.g 'Zoom', 'WebEx'
    data.confId = 'Active conference sysId';
    data.items.push({ id: 'userSysId' });
    data.items.push({ phoneNumber: '+917799555331' });
    data.items.push({ email: 'yln99518@gmail.com' });

    NotifyOnTaskClient.addParticipants(data).then(function (result) {
        var joinActionResult = result[0];
        if(joinActionResult.status) {
            joinActionResult.successMessages.forEach(function(msg) {
                console.log(msg);
            });
            return;
        }

        joinActionResult.warnMessages.forEach(function(msg) {
            console.warn(msg);
        });
        joinActionResult.errorMessages.forEach(function(msg) {
            console.error(msg);
        });
    }, function (errMsg) {
        console.log(errMsg);
    });
}

NotifyOnTaskClient - doConferenceAction(String action, Object data)

Performs the specified conference call action, such as starting/ending a conference call or joining, removing, muting, or unmuting participants from a conference call.

You can start a new conference call and add participants within a single call to this method or call the method multiple times to start the call and then manage participants separately. In addition, through the passed in data object, you can configure the method to:
  • Save pointers in the conference call record to the specific record (source record), such as an incident or problem, that is the topic of discussion for the conference call.
  • Allow/disallow multiple conference calls for a source record.
  • Automatically log the participants that were in the conference call in the Work notes field of the source record.
  • Have a message read aloud when a participant answers an outgoing call from the conference.
Table 4. Returns
Type Description
Object Results of the conference action.

<action>.status: Status of the conference action.

  • Data type: Boolean
  • Possible values:
    • true: Conference action succeeded
    • false: Conference action failed

<action>.successMessages: If status is true, success message(s), else empty.

  • Data type: Array of Strings

<action>.warnMessages: If status is false, any warning messages thrown during processing.

  • Data type: Array of Strings

<action>.errorMessages: If status is false, any error messages thrown during processing.

  • Data type: Array of Strings

Example

The following example shows how to create a function to call doConferenceAction() to manipulate the participants in a conference call by passing in the action and the participants.


/**
 * 
 * @param {string} action - action to perform on the conference object or participant object
 * @param {Array} participants;
 */
function doConferenceAction(action, participants) {
    var data = NotifyOnTaskClient.getNotifyActionTemplate();
    data.serviceProvider = 'Telephony'; // e.g 'Zoom', 'WebEx'
    data.confId = 'Active conference sysId';
    data.items = participants;

    NotifyOnTaskClient.doConferenceAction(action, data).then(function (result) {
        var kickActionResult = result[0];
        if (kickActionResult.status)
            console.log(action + ' succeeded');
        else {
            kickActionResult.warnMessages.forEach(function (msg) {
                console.warn(msg);
            });
            kickActionResult.errorMessages.forEach(function (msg) {
                console.error(msg);
            });
        }
    }, function (errMsg) {
            console.log(errMsg)
    });
}

// kick participants

doConferenceAction('kick', [{notifyParticipantId: 'notifyParticipantSysId'}]);

// kick multiple participants

doConferenceAction('multiKick',
    [{notifyParticipantId: 'notifyParticipantSysId'},
    {notifyParticipantId: 'notifyParticipantSysId'}]);

// Mute participants
doConferenceAction('mute', [{notifyParticipantId: 'notifyParticipantSysId'}]);
doConferenceAction('mute', [{notifyParticipantId: 'notifyParticipantSysId'}]);

doConferenceAction('multiMute',
    [{notifyParticipantId: 'notifyParticipantSysId'},
    {notifyParticipantId: 'notifyParticipantSysId'}]);

// self join to any confernece. 
doConferenceAction('selfJoin', [{id: 'logged in userId'}]);

NotifyOnTaskClient - endConference(Object data)

Terminates the specified conference call.

Table 5. Parameters
Name Type Description
data Object Object that describes the conference call.
data.confId String Sys_id of the conference call.
data.serviceProvider String Required. Name of conference service provider, such as Zoom or Webex.
Table 6. Returns
Type Description
Object Results of the conference action.

<action>.status: Status of the conference action.

  • Data type: Boolean
  • Possible values:
    • true: Conference action succeeded
    • false: Conference action failed

<action>.successMessages: If status is true, success message(s), else empty.

  • Data type: Array of Strings

<action>.warnMessages: If status is false, any warning messages thrown during processing.

  • Data type: Array of Strings

<action>.errorMessages: If status is false, any error messages thrown during processing.

  • Data type: Array of Strings

Example

function endConferenceCall() {
    var data = NotifyOnTaskClient.getNotifyActionTemplate();
    data.serviceProvider = 'Telephony'; // e.g 'Zoom', 'WebEx'
    data.confId = 'Active conference sysId';

    NotifyOnTaskClient.endConference(data).then(function (result) {
        var endActionResult = result[0];
        if (endActionResult.status)
            console.log('Conference has been ended');
        else {
            endActionResult.warnMessages.forEach(function (msg) {
                console.warn(msg);
            });
            endActionResult.errorMessages.forEach(function (msg) {
                console.error(msg);
            });
        }
    }, function (errMsg) {
        console.log(errMsg);
    });
}

NotifyOnTaskClient - getNotifyActionTemplate()

Returns a JSON data template to use with the doConferenceAction() method. Using this template automatically structures the data object so that you don't have to manually create it.

Call this method prior to calling the doConferenceAction() method. For the desired conference call action, set the desired parameters within the template, and then pass the template in the doConferenceAction() call. For additional information on the valid parameters for each action, see doConferenceAction().

Note: This is a helper method. You can also manually construct this object and pass it into the doConferenceAction() method and have the same outcome.
Table 7. Parameters
Name Type Description
None

Example

The following example shows how to call getNotifyActionTemplate() to obtain the data template necessary to define the actions for doConferenceAction().


/**
 * 
 * @param {string} action - action to perform on the conference object or participant object
 * @param {Array} participants;
 */
function doConferenceAction(action, participants) {
    var data = NotifyOnTaskClient.getNotifyActionTemplate();
    data.serviceProvider = 'Telephony'; // e.g 'Zoom', 'WebEx'
    data.confId = 'Active conference sysId';
    data.items = participants;

    NotifyOnTaskClient.doConferenceAction(action, data).then(function (result) {
        var kickActionResult = result[0];
        if (kickActionResult.status)
            console.log(action + ' succeeded');
        else {
            kickActionResult.warnMessages.forEach(function (msg) {
                console.warn(msg);
            });
            kickActionResult.errorMessages.forEach(function (msg) {
                console.error(msg);
            });
        }
    }, function (errMsg) {
            console.log(errMsg)
    });
}

// kick participants

doConferenceAction('kick', [{notifyParticipantId: 'notifyParticipantSysId'}]);

// kick multiple participants

doConferenceAction('multiKick',
    [{notifyParticipantId: 'notifyParticipantSysId'},
    {notifyParticipantId: 'notifyParticipantSysId'}]);

// Mute participants
doConferenceAction('mute', [{notifyParticipantId: 'notifyParticipantSysId'}]);
doConferenceAction('mute', [{notifyParticipantId: 'notifyParticipantSysId'}]);

doConferenceAction('multiMute',
    [{notifyParticipantId: 'notifyParticipantSysId'},
    {notifyParticipantId: 'notifyParticipantSysId'}]);

// self join to any confernece. 
doConferenceAction('selfJoin', [{id: 'logged in userId'}]);

NotifyOnTaskClient - start(Object data)

Starts a new conference call.

Table 10. Returns
Type Description
Object Results of the conference action.

<action>.status: Status of the conference action.

  • Data type: Boolean
  • Possible values:
    • true: Conference action succeeded
    • false: Conference action failed

<action>.successMessages: If status is true, success message(s), else empty.

  • Data type: Array of Strings

<action>.warnMessages: If status is false, any warning messages thrown during processing.

  • Data type: Array of Strings

<action>.errorMessages: If status is false, any error messages thrown during processing.

  • Data type: Array of Strings

Example

The following code example shows how to call this method.

function startConferenceCall() {
    var data = NotifyOnTaskClient.getNotifyActionTemplate();
    data.table = 'incident';
    data.sysId = '1234';
    data.serviceProvider = serviceProvider;
    data.addToWorkNotes = true;
    data.fromNumber = 'Telephony Number';
    data.items.push({ id: 'userSysId' });
    data.items.push({ phoneNumber: '+917799555332' });
    data.items.push({ email: 'yln99517@gmail.com' });

    NotifyOnTaskClient.start(data).then(function (result) {
        var startActionResult = result[0];
        if(startActionResult.status) {
            startActionResult.successMessages.forEach(function(msg) {
                console.log(msg);
            });
            return;
        }

        startActionResult.warnMessages.forEach(function(msg) {
            console.warn(msg);
        });
        startActionResult.errorMessages.forEach(function(msg) {
            console.error(msg);
        });
    }, function (errMsg) {
        console.log(errMsg);
    });
}