system.twilio.getPhoneNumbers
This function is used in Python Scripting.
Descriptionβ
Returns a list of outgoing phone numbers for a Twilio account. Note that these numbers are supplied by Twilio, and are not defined on a user in Ignition.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntaxβ
system.twilio.getPhoneNumbers(accountName)
Parametersβ
| Type | Parameter | Description |
|---|---|---|
| String | accountName | The Twilio account to retrieve phone numbers for |
Returnsβ
List[String] - A list of phone numbers for the given Twilio account
Scopeβ
Gateway, Vision Client, Perspective Session
Code Examplesβ
Code Snippet
# Retrieves a list of phone numbers associated with a Twilio account and then iterates through the resulting list.
# Checks against a Twilio profile configured on the Gateway by the name of "Twilio Account".
# Call system.twilio.getPhoneNumbers() and store the returned list into a variable.
twilioNumbers = system.twilio.getPhoneNumbers("Twilio Account")
# Iterate through the list of numbers.
for number in twilioNumbers:
# Prints the numbers to the console
print number