NotifyScoped - Scoped
-
- UpdatedJan 30, 2025
- 8 minutes to read
- Yokohama
- API reference
The NotifyScoped API allows you to interact with Notify calls and SMS messages using scripts.
Execute the NotifyScoped class and its associated methods from the
sn_notify
namespace.
NotifyScoped - call(String notifyPhoneNumber, String toPhoneNumber, GlideRecord conferenceCall, GlideRecord conferenceCallRecord, String userSysId, String groupSysId, GlideRecord sourceRecord)
Calls the specified E.164-compliant telephone number.
Type | Description |
---|---|
void |
Example
This example illustrates how to initiate a call to another phone number.
Example
This example illustrates how to initiate a call to a list of telephone numbers and automatically join those numbers into a new conference call.
NotifyScoped - conferenceCall(GlideRecord sourceRecord)
Creates a new conference call GlideRecord.
Name | Type | Description |
---|---|---|
sourceRecord | GlideRecord | Optional. Record that initiated the request to create the conference call. Used to populate the source and table fields on notify_conference_call record. |
Type | Description |
---|---|
GlideRecord | New Notify conference call [notify_conference_call] record. |
Example
NotifyScoped - dequeueCall(GlideRecord callRecord)
Resumes a call after it was put in a queue (on hold).
Use this method to resume calls that were put in a queue with the queueCall() method.
Name | Type | Description |
---|---|---|
callRecord | GlideRecord | GlideRecord object on the Notify Call [notify_call] table with the held call you want to resume. |
Type | Description |
---|---|
void |
Example
The following example shows how to reactivate a call that was put on hold.
NotifyScoped - forwardCall(GlideRecord call, String destination, String dtmf)
Forwards the specified call to a different call recipient.
Name | Type | Description |
---|---|---|
call | GlideRecord or String | Notify call record or the telephony provider call ID, of the call to be forwarded. |
destination | GlideRecord or String | Notify phone number record or an E.164-compliant phone number, of the caller to which to forward the call. |
dtmf | String | Dual Tone - Multi Frequency (DTMF) code to send upon call connection. |
Type | Description |
---|---|
void |
Example
The following example shows how to forward a call to another phone number.
NotifyScoped - getAvailableClients(String notifyNumber)
Returns a list of client sessions that are available to receive calls.
Name | Type | Description |
---|---|---|
notifyNumber | String | Valid Notify phone number. |
Type | Description |
---|---|
Array | GlideRecord from the notify_client_session table for the specified phone
number. Returns "0" if there are no available client sessions. |
Example
The following example shows how to use the getAvailableClients() method to index into the notify_client_session table and then iterate across all available Notify clients.
NotifyScoped - getPhoneNumbers()
Returns all phone numbers and short codes available to Notify.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Array | List of NotifyPhoneNumber objects, each object representing one phone number available to Notify. |
Example
This example illustrates how to obtain the Notify phone numbers and then iterate over the list.
NotifyScoped - getShortCodes()
Returns all short codes available to Notify.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
void |
Example
This example illustrates how to obtain the Notify short codes and then iterate over the list.
NotifyScoped - getTokens(GlideRecord, record)
Returns client tokens for any active telephony drivers for use in WebRTC or mobile clients.
This method uses the currently logged-in user record as the client.
Name | Type | Description |
---|---|---|
record | GlideRecord | GlideRecord to use to identify the Notify client, such as a group record or a user record. |
Type | Description |
---|---|
String | Web RTC tokens for the supported drivers, as a JSON string with the following format: {driverName1: "token1", driverName2: "token2"}, such as "TwilioDirect":"eyJhxxxx.eyJleHAiOiIxxxx.7fejxxx_mbLxxx" |
Example
This example shows how to obtain the client tokens for the currently logged in user.
Example
This example shows how to obtain the client tokens for every Notify group.
Example
This example illustrates how to obtain the client tokens for the active telephony drivers.
Output:
NotifyScoped - getTokenTTL(String owner)
Returns the maximum amount of time that a client session stays active for a specified telephony driver before automatically timing out.
Name | Type | Description |
---|---|---|
owner | String | Name of the telephony driver for which to retrieve the session length. Valid values:
|
Type | Description |
---|---|
Integer | Maximum length of the session (in seconds). Default: 1800 seconds |
Example
The following example shows how to properly call this method and the associated response. It also shows what is returned if an invalid driver is passed.
NotifyScoped - hasCapability(String notifyPhoneNumber, String capability)
Determines whether the specified phone number has the specified capability.
The telephony driver associated with the phone number contains a list of all of the capabilities of the phone.
Name | Type | Description |
---|---|---|
notifyPhoneNumber | String | Phone number for which to check for the specified capability. |
capability | String | Capability to detect. The string text must be an exact match to what is in the phone. |
Type | Description |
---|---|
Boolean | Flag that indicates whether the specified phone has the specified
capability.
|
Example
This example shows how to check if a phone has a specific capability.
NotifyScoped - kick(GlideRecord participant)
Removes the specified caller from the current Notify conference call.
Name | Type | Description |
---|---|---|
participant | GlideRecord | GlideRecord object containing the Notify Participant [notify_participant] record of the caller to remove from the conference call. |
Type | Description |
---|---|
void |
Example
This example shows how to remove a participant from a call.
NotifyScoped - modifyCall(GlideRecord callRecord, NotifyAction notifyAction)
Performs one or more activities on an active Notify phone call.
Name | Type | Description |
---|---|---|
callRecord | GlideRecord | Notify Call [notify_call] record of the call for which to apply the actions. |
notifyAction | NotifyAction | NotifyAction object describing one or more activities to perform on the call. |
Type | Description |
---|---|
void |
NotifyScoped - mute(GlideRecord participantRecord)
Mutes the specified conference call participant.
Name | Type | Description |
---|---|---|
participantRecord | GlideRecord | GlideRecord from the notify_participant table for the participant to mute. |
Type | Description |
---|---|
void |
Example
The following example shows how to mute a caller.
NotifyScoped - queueCall(GlideRecord callRecord)
Puts the specified call into a queue (on hold).
Resume a queued call using the dequeueCall() method.
Name | Type | Description |
---|---|---|
callRecord | GlideRecord | GlideRecord object of the Notify Call record (notify_call table) to put on hold. |
Type | Description |
---|---|
void |
Example
NotifyScoped - sendBulkSMS(NotifyPhoneNumber notifyPhoneNumber, String toPhoneNumbers, String messageBody, GlideRecord source)
Sends a specified SMS message to the specified list of Notify clients (phone numbers).
Type | Description |
---|---|
String | Null |
Example
This example shows how to send an SMS message to multiple phone numbers (bulk SMS).
NotifyScoped - sendSMS(NotifyPhoneNumber notifyPhoneNumber, String toPhoneNumber, String messageBody, GlideRecord source)
Sends an SMS text message to an E.164-compliant phone number.
This method creates a new record on the Notify Message [notify_message] table and associates it with the source record.
Type | Description |
---|---|
String | Unique message SID; stored in the Notify Message [notify_message] record as message_id. |
Example
The following example shows how to send an SMS message.
NotifyScoped - unmute(GlideRecord participantRecord)
Unmutes the specified conference call participant.
Name | Type | Description |
---|---|---|
participantRecord | GlideRecord | GlideRecord from the notify_participant table for the participant to unmute. |
Type | Description |
---|---|
void |
Example
This example shows how to unmute a specified call participant.
On this page
- NotifyScoped - call(String notifyPhoneNumber, String toPhoneNumber, GlideRecord
conferenceCall, GlideRecord conferenceCallRecord, String userSysId, String groupSysId,
GlideRecord sourceRecord)
- NotifyScoped - conferenceCall(GlideRecord sourceRecord)
- NotifyScoped - dequeueCall(GlideRecord callRecord)
- NotifyScoped - forwardCall(GlideRecord call, String destination, String dtmf)
- NotifyScoped - getAvailableClients(String notifyNumber)
- NotifyScoped - getPhoneNumbers()
- NotifyScoped - getShortCodes()
- NotifyScoped - getTokens(GlideRecord, record)
- NotifyScoped - getTokenTTL(String owner)
- NotifyScoped - hasCapability(String notifyPhoneNumber, String capability)
- NotifyScoped - kick(GlideRecord participant)
- NotifyScoped - modifyCall(GlideRecord callRecord, NotifyAction notifyAction)
- NotifyScoped - mute(GlideRecord participantRecord)
- NotifyScoped - queueCall(GlideRecord callRecord)
- NotifyScoped - sendBulkSMS(NotifyPhoneNumber notifyPhoneNumber, String toPhoneNumbers,
String messageBody, GlideRecord source)
- NotifyScoped - sendSMS(NotifyPhoneNumber notifyPhoneNumber, String toPhoneNumber, String
messageBody, GlideRecord source)
- NotifyScoped - unmute(GlideRecord participantRecord)