Notify - getTokens(GlideRecord record)

Get client tokens for any installed telephony drivers for use in WebRTC or mobile clients.

Table 1. Parameters
Name Type Description
record GlideRecord A record used to generate the client tokens.
Table 2. Returns
Type Description
String The client tokens. The value of the string depends on the GlideRecord parameter.

This example demonstrates getting Notify client tokens for every Notify group.

// instantiate Notify
var notify = new SNC.Notify();

// get all Notify Groups
var notifyGroup = new GlideRecord("notify_group");
notifyGroup.query();

// iterate over all notify groups
while (notifyGroup.next()) {
    // generate Notify Client tokens per active Notify Driver for this group
    var json = notify.getTokens(notifyGroup);
    var tokens = JSON.parse(json);

    for (var driver in tokens) {
        gs.log(gs.getMessage("Notify Client token for {0} driver and Notify Group '{1}': {2}", [driver, notifyGroup.getValue('name'), tokens[driver]]));
    }
}