PhoneNumbers
Methods
AttachPhoneNumber
Attach the phone number to the account. Note that phone numbers of some countries may require additional verification steps.
Please note that when you purchase a phone number, we reserve the subscription fee and taxes for the upcoming month. Read more in the Billing page.
To call this method, make sure your service account has one of the following roles:
Parameters
country_code:
string
The country code
country_state:
string
OptionalThe country state. See the GetPhoneNumberCategories and GetPhoneNumberCountryStates methods
phone_category_name:
string
The phone category name. See the GetPhoneNumberCategories method
phone_count:
number
The phone count to attach
phone_number:
stringlist
The phone number that can be used instead of phone_count. See the GetNewPhoneNumbers method
phone_region_id:
number
The phone region ID. See the GetPhoneNumberRegions method
regulation_address_id:
number
OptionalThe phone regulation address ID
Returns
phone_numbers:
The attached phone numbers
result:
number
1
BindPhoneNumberToApplication
Bind the phone number to the application or unbind the phone number from the application. You should specify the application_id or application_name if you specify the rule_name.
To call this method, make sure your service account has one of the following roles:
Parameters
application_id:
number
The application ID
application_name:
string
The application name that can be used instead of application_id
bind:
boolean
OptionalDefaults on:Â Â trueWhether to bind or unbind (set true or false respectively)
phone_id:
intlist
The phone ID list separated by semicolons (;). Use the 'all' value to select all phone ids
phone_number:
stringlist
The phone number list separated by semicolons (;) that can be used instead of phone_id
rule_id:
number
OptionalThe rule ID
rule_name:
string
OptionalThe rule name that can be used instead of rule_id
Returns
result:
number
1
DeactivatePhoneNumber
Deactivates the phone number.
To call this method, make sure your service account has one of the following roles:
Parameters
phone_id:
intlist
The phone ID list separated by semicolons (;). Use the 'all' value to select all phone ids
phone_number:
stringlist
The phone number list separated by semicolons (;) that can be used instead of phone_id
Returns
result:
number
1
GetAccountPhoneNumberCountries
Gets all countries where the specific account has phone numbers.
To call this method, make sure your service account has one of the following roles:
Parameters
application_id:
intlist
OptionalThe application ID list separated by semicolons (;) to filter
Returns
result:
[string]
Array of country codes
GetActualPhoneNumberRegion
Get actual info on the country region of the phone numbers. The response also contains the info about multiple numbers subscription for the child accounts.
Parameters
country_code:
string
The country code
country_state:
string
OptionalThe country state code (example: AL, CA, … )
locale:
string
OptionalThe 2-letter locale code. Supported values are EN, RU
phone_category_name:
string
The phone category name. See the GetPhoneNumberCategories method
phone_region_id:
number
The phone region ID to filter
Returns
GetNewPhoneNumbers
Gets the new phone numbers.
To call this method, make sure your service account has one of the following roles:
Parameters
count:
number
OptionalDefaults on:Â Â 20The max returning record count
country_code:
string
The country code
country_state:
string
OptionalThe country state. See the GetPhoneNumberCategories and GetPhoneNumberCountryStates functions
offset:
number
OptionalDefaults on:Â Â 0The first N records are skipped in the output
phone_category_name:
string
The phone category name. See the GetPhoneNumberCategories function
phone_number_mask:
string
OptionalThe phone number searching mask. Asterisk represents zero or more occurrences of any character
phone_region_id:
number
The phone region ID. See the GetPhoneNumberRegions method
Returns
count:
number
The returned phone count
result:
total_count:
number
The total found phone count
GetPhoneNumberCategories
Gets the phone number categories.
To call this method, make sure your service account has one of the following roles:
Parameters
country_code:
stringlist
OptionalCountry code list separated by semicolons (;)
locale:
string
OptionalThe 2-letter locale code. Supported values are EN, RU
sandbox:
string
OptionalFlag allows you to display phone number categories only of the sandbox, real or all .The following values are possible: 'all', 'true', 'false'
Returns
result:
GetPhoneNumberCountryStates
Gets the phone number country states.
To call this method, make sure your service account has one of the following roles:
Parameters
country_code:
string
The country code
country_state:
string
OptionalThe country state code (example: AL, CA, … )
phone_category_name:
string
The phone category name. See the GetPhoneNumberCategories function
Returns
GetPhoneNumberRegions
Get the country regions of the phone numbers. The response also contains the info about multiple numbers subscription for the child accounts.
To call this method, make sure your service account has one of the following roles:
Parameters
country_code:
string
The country code
country_state:
string
OptionalThe country state code (example: AL, CA, … )
locale:
string
OptionalThe 2-letter locale code. Supported values are EN, RU
omit_empty:
boolean
OptionalDefaults on:Â Â trueWhether not to show all the regions (with and without phone numbers in stock)
phone_category_name:
string
The phone category name. See the GetPhoneNumberCategories method
phone_region_code:
string
OptionalThe region phone prefix to filter
phone_region_id:
number
OptionalThe phone region ID to filter
phone_region_name:
string
OptionalThe phone region name to filter
Returns
GetPhoneNumbers
Gets the account phone numbers.
To call this method, make sure your service account has one of the following roles:
Parameters
application_id:
number
OptionalThe application ID
application_name:
string
OptionalThe application name that can be used instead of application_id
auto_charge:
boolean
OptionalWhether the auto_charge flag is enabled
can_be_used:
boolean
OptionalWhether a not verified account can use the phone
canceled:
boolean
OptionalWhether the subscription is cancelled to filter
child_account_id:
intlist
OptionalThe child account ID list separated by semicolons (;). Use the 'all' value to select all child accounts
children_phones_only:
boolean
OptionalDefaults on:Â Â falseWhether to get the children phones only
count:
number
OptionalDefaults on:Â Â 100The max returning record count
country_code:
stringlist
OptionalThe country code list separated by semicolons (;)
deactivated:
boolean
OptionalWhether the subscription is frozen to filter
from_phone_next_renewal:
date
OptionalThe UTC 'from' date filter in format: YYYY-MM-DD
from_phone_purchase_date:
timestamp
OptionalThe UTC 'from' date filter in 24-h format: YYYY-MM-DD HH:mm:ss
from_unverified_hold_until:
date
OptionalUnverified phone hold until the date (from …) in format: YYYY-MM-DD
is_bound_to_application:
boolean
OptionalWhether the phone number bound to an application
is_bound_to_rule:
boolean
OptionalWhether the phone number is bound to some rule
offset:
number
OptionalDefaults on:Â Â 0The first N records are skipped in the output
order_by:
string
OptionalThe following values are available: 'phone_number' (ascent order), 'phone_price' (ascent order), 'phone_country_code' (ascent order), 'deactivated' (deactivated first, active last), 'purchase_date' (descent order), 'phone_next_renewal' (ascent order), 'verification_status', 'unverified_hold_until' (ascent order), 'verification_name'
phone_category_name:
string
OptionalThe phone category name. See the GetPhoneNumberCategories method
phone_id:
intlist
OptionalThe particular phone ID to filter
phone_number:
stringlist
OptionalThe phone number list separated by semicolons (;) that can be used instead of phone_id
phone_region_name:
stringlist
OptionalThe region names list separated by semicolons (;)
phone_template:
string
OptionalThe phone number start to filter
rule_id:
intlist
OptionalThe rule ID list separated by semicolons (;)
rule_name:
stringlist
OptionalThe rule names list separated by semicolons (;). Can be used only if application_id or application_name is specified
sandbox:
string
OptionalFlag allows you to display only the numbers of the sandbox, real numbers, or all numbers. The following values are possible: 'all', 'true', 'false'
to_phone_next_renewal:
date
OptionalThe UTC 'to' date filter in format: YYYY-MM-DD
to_phone_purchase_date:
timestamp
OptionalThe UTC 'to' date filter in 24-h format: YYYY-MM-DD HH:mm:ss
to_unverified_hold_until:
date
OptionalUnverified phone hold until the date (… to) in format: YYYY-MM-DD
verification_name:
string
OptionalThe required account verification name to filter
verification_status:
stringlist
OptionalThe account verification status list separated by semicolons (;). The following values are possible: REQUIRED, IN_PROGRESS, VERIFIED
Returns
count:
number
The returned phone count
result:
Phone numbers info
total_count:
number
The total found phone count
SetPhoneNumberInfo
Set the phone number information.
To call this method, make sure your service account has one of the following roles:
Parameters
incoming_sms_callback_url:
string
OptionalIf set, the callback of an incoming SMS is sent to this url, otherwise, it is sent to the general account URL
phone_id:
intlist
The phone ID list separated by semicolons (;). Use the 'all' value to select all phone ids
phone_number:
stringlist
The phone number list separated by semicolons (;) that can be used instead of phone_id
Returns
result:
number
1