Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

Notify - getShortCodes()

Notify - getShortCodes()

Get all short codes available to Notify, as an array.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
Array An array of NotifyPhoneNumber objects, each object representing one short code available to Notify.

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

// get all available shortcodes
var shortCodes = notify.getShortCodes();

// iterate over phone numbers
for (var i = 0; i < shortCodes.size(); i++) {

var shortCode = shortCodes.get(i);

gs.log(shortCode.getNumber());

//perform any actions using each shortcode
}