NotifyOnTaskClient - Client
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.
| Name | Type | Description |
|---|---|---|
| data | Object | Object that describes the conference call. |
| data.addToWorkNotes | Boolean | Flag that indicates whether to add information about the participants that were included in the conference call in the work notes field of the associated record.
For this functionality to work, you must also specify values in the data.table and data.sysId parameters. These parameters identify the record in which to add the work notes. Default: false |
| data.confId | String | Sys_id of the conference call. Table: Notify Conference Call [notify_conference_call] |
| data.items | Array |
Information for each participant to include in the conference call.
|
| data.items.email | String | Email address of the participant. |
| data.items.id | String | User sys_id. Table: User [sys_User] |
| data.items.notifyParticipantId | String | Participant sys_id. Table: Notify Participant [notify_participant] |
| data.items.phoneNumber | String | Phone number of the participant. If this value is passed in conjunction with either the id or notifyParticipantId parameter, this value supersedes the phone numbers in the user/participant record and is used to place the call. |
| data.message | String | Message that is read aloud when a user answers the call, such as, "P1 incident has been created please login to instance." |
| data.serviceProvider | String | Required. Name of conference service provider, such as Zoom or Webex. |
| data.sysId | String | Sys_id of the source record to associate with the conference call.
For example, if a conference call is held to discuss a specific incident or problem, put the sys_id of the incident or problem record in this value. This sys_id is stored in the Source column of the NotifyConference Call [notify_conference_call] table and can later be tracked. This parameter is used in conjunction with the data.Table, data.addToWorkNotes, and allowMulticonference parameters. You should configure this value when the conference call is initially created through a "start" action. If required, you can also set this value through this method. |
| data.table | String | Table that contains the source record to associate with the conference call. A source record can be any record, such as an "incident" or "problem", that is the topic of discussion in the
conference call.
This table name is stored in the Table column of the NotifyConference Call [notify_conference_call] table and can be tracked. This parameter is used in conjunction with the data.sysId, data.addToWorkNotes, and allowMulticonference parameters. You should configure this value when the conference call is initially created through a "start" action. If required, you can also set this value through this method. |
| Type | Description |
|---|---|
| Object | Results of the conference action.
|
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.
- 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.
| Name | Type | Description |
|---|---|---|
| action | String | Defines the conference call action to perform. The
following are the available conference call actions:
|
| data | Object | Object that describes the conference call. |
| data.addToWorkNotes | Boolean | Flag that indicates whether to add information about the participants that were included in the conference call in the work notes field of the associated record.
For this functionality to work, you must also specify values in the data.table and data.sysId parameters. These parameters identify the record in which to add the work notes. Default: false Actions for which this parameter is valid:
|
| data.allowMulticonference | Boolean | Flag that indicates whether to allow multiple conference calls for a specific record at one time.
For this functionality to work, you must also specify values in the data.table and data.sysId parameters. These parameters identify the record that is allowed to have multiple conference calls. Default: false Actions for which this parameter is valid:
|
| data.confId | String | Sys_id of the conference call.
Table: Notify Conference Call [notify_conference_call] Actions for which this parameter is required:
주:
Participant actions such as mute, unmute, and kick don't require this parameter to be set as the method obtains this information from the Notify Conference Call Participant [notify_participant] table. |
| data.fromNumber | String | Service provider number to call into for the conference call.
Locate this value in the Number or Phone number column of the Notify Phone Number [notify_number] table. Actions for which this parameter is required:
|
| data.isNewConference | Boolean | Flag that indicates whether this is a new or an existing conference call.
Valid values:
Default: false Actions for which this parameter is valid:
|
| data.message | String | Message that is read aloud when a user answers the call, such as, "P1 incident has been created please login to instance."
Actions for which this parameter is valid:
|
| data.items | Array | Information for each participant to include in the conference call.
Valid array values:
|
| data.serviceProvider | String | Required. Name of conference service provider, such as Zoom or Webex.
Actions for which this parameter is required:
|
| data.sysId | String | Sys_id of the source record to associate with the conference call.
For example, if a conference call is held to discuss a specific incident or problem, put the sys_id of the incident or problem record in this value. This sys_id is stored in the Source column of the NotifyConference Call [notify_conference_call] table and can later be tracked. This parameter is used in conjunction with the data.Table, data.addToWorkNotes, and allowMulticonference parameters. Actions for which this parameter is valid:
|
| data.table | String | Table that contains the source record to associate with the conference call. A source record can be any record, such as an "incident" or "problem", that is the topic of discussion in the
conference call.
This table name is stored in the Table column of the NotifyConference Call [notify_conference_call] table and can be tracked. This parameter is used in conjunction with the data.sysId, data.addToWorkNotes, and allowMulticonference parameters. Actions for which this parameter is valid:
|
| Type | Description |
|---|---|
| Object | Results of the conference action.
|
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.
| 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. |
| Type | Description |
|---|---|
| Object | Results of the conference action.
|
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().
| Name | Type | Description |
|---|---|---|
| None |
| Type | Description |
|---|---|
| data | Object that describes the conference call. |
| data.addToWorkNotes | Flag that indicates whether to add information about the participants that were included in the conference call in the work notes field of the associated record.
For this functionality to work, you must also specify values in the data.table and data.sysId parameters. These parameters identify the record in which to add the work notes. Default: false Actions for which this parameter is valid:
|
| data.allowMultconference | Flag that indicates whether to allow multiple conference calls for a specific record at one time.
For this functionality to work, you must also specify values in the data.table and data.sysId parameters. These parameters identify the record that is allowed to have multiple conference calls. Default: false Actions for which this parameter is valid:
|
| data.confId | Sys_id of the conference call.
Table: Notify Conference Call [notify_conference_call] Actions for which this parameter is required:
주:
Participant actions such as mute, unmute, and kick don't require this parameter to be set as the method obtains this information from the Notify Conference Call Participant [notify_participant] table. |
| data.fromNumber | Service provider number to call into for the conference call.
Locate this value in the Number or Phone number column of the Notify Phone Number [notify_number] table. Actions for which this parameter is required:
|
| data.isNewConference | Flag that indicates whether this is a new or an existing conference call.
Valid values:
Default: false Actions for which this parameter is valid:
|
| data.items | Information for each participant to include in the conference call.
Valid array values:
|
| data.message | Message that is read aloud when a user answers the call, such as, "P1 incident has been created please login to instance."
Actions for which this parameter is valid:
|
| data.serviceProvider | Required. Name of conference service provider, such as Zoom or Webex.
Actions for which this parameter is required:
|
| data.sysId | Sys_id of the source record to associate with the conference call.
For example, if a conference call is held to discuss a specific incident or problem, put the sys_id of the incident or problem record in this value. This sys_id is stored in the Source column of the NotifyConference Call [notify_conference_call] table and can later be tracked. This parameter is used in conjunction with the data.Table, data.addToWorkNotes, and allowMulticonference parameters. Actions for which this parameter is valid:
|
| data.table | Table that contains the source record to associate with the conference call. A source record can be any record, such as an "incident" or "problem", that is the topic of discussion in the
conference call.
This table name is stored in the Table column of the NotifyConference Call [notify_conference_call] table and can be tracked. This parameter is used in conjunction with the data.sysId, data.addToWorkNotes, and allowMulticonference parameters. Actions for which this parameter is valid:
|
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.
| Name | Type | Description |
|---|---|---|
| data | Object | Object that describes the conference call. |
| data.addToWorkNotes | Boolean | Optional.Flag that indicates whether to add information about the participants that were included in the conference call in the work notes field of the associated record.
For this functionality to work, you must also specify values for the data.table and data.sysId parameters to identify the record in which to add the work notes. Default: false |
| data.allowMulticonference | Boolean | Optional. Flag that indicates whether to allow multiple conference calls for a specific record at one time.
For this functionality to work, you must also specify values in the data.table and data.sysId parameters. These parameters identify the record that is allowed to have multiple conference calls. Default: false |
| data.fromNumber | String | Required. Service provider number to call into for the conference call.
Locate this value in the Number or Phone number column of the Notify Phone Number [notify_number] table. |
| data.items | Array | Optional. Information for each participant to include in the conference call.
|
| data.items.email | String | Email address of the participant. |
| data.items.id | String | User sys_id. Table: User [sys_User] |
| data.items.notifyParticipantId | String | Participant sys_id. Table: Notify Participant [notify_participant] |
| data.items.phoneNumber | String | Phone number of the participant. If this value is passed in conjunction with either the id or notifyParticipantId parameter, this value supersedes the phone numbers in the user/participant record and is used to place the call. |
| data.message | String | Optional. Message that is read aloud when a user answers the call, such as, "P1 incident has been created please login to instance." |
| data.serviceProvider | String | Required. Name of conference service provider, such as Zoom or Webex. |
| data.sysId | String | Optional. Sys_id of the source record to associate with the conference call.
For example, if a conference call is held to discuss a specific incident or problem, put the sys_id of the incident or problem record in this value. This sys_id is stored in the Source column of the NotifyConference Call [notify_conference_call] table and can later be tracked. This parameter is used in conjunction with the data.Table, data.addToWorkNotes, and allowMulticonference parameters. |
| data.table | String | Optional. Table that contains the source record to associate with the conference call. A source record can be any record, such as an "incident" or "problem", that is the topic of discussion in the
conference call.
This table name is stored in the Table column of the NotifyConference Call [notify_conference_call] table and can be tracked. This parameter is used in conjunction with the data.sysId, data.addToWorkNotes, and allowMulticonference parameters. |
| Type | Description |
|---|---|
| Object | Results of the conference action.
|
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);
});
}