PhoneNumbers
Methods
AttachPhoneNumber
Attach the phone number to the account. Note that phone numbers of some countries may require additional verification steps.
To call this method, make sure your service account has one of the following roles:
Parameters
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
country_code:
string
The country code
phone_category_name:
string
The phone category name. See the GetPhoneNumberCategories method
country_state:
string
OptionalThe country state. See the GetPhoneNumberCategories and GetPhoneNumberCountryStates methods
phone_region_id:
number
The phone region ID. See the GetPhoneNumberRegions method
regulation_address_id:
number
OptionalThe phone regulation address ID
Returns
result:
number
1
phone_numbers:
The attached phone numbers
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
phone_id:
intlist
The phone ID list separated by semicolon (;). Use the 'all' value to select all phone ids
phone_number:
stringlist
The phone number list separated by semicolon (;) that can be used instead of phone_id
application_id:
number
The application ID
application_name:
string
The application name that can be used instead of application_id
rule_id:
number
OptionalThe rule ID
rule_name:
string
OptionalThe rule name that can be used instead of rule_id
bind:
boolean
OptionalDefaults on: trueBind or unbind (set true or false respectively)
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 semicolon (;). Use the 'all' value to select all phone ids
phone_number:
stringlist
The phone number list separated by semicolon (;) that can be used instead of phone_id
Returns
result:
number
1
SetPhoneNumberInfo
Set the phone number information.
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 semicolon (;). Use the 'all' value to select all phone ids
phone_number:
stringlist
The phone number list separated by semicolon (;) that can be used instead of phone_id
incoming_sms_callback_url:
string
OptionalIf set, the callback of an inbound SMS will be sent to this url, otherwise, it will be sent to the general account URL
Returns
result:
number
1
GetPhoneNumbers
Gets the account phone numbers.
To call this method, make sure your service account has one of the following roles:
Parameters
phone_id:
intlist
OptionalThe particular phone ID to filter
phone_number:
stringlist
OptionalThe phone number list separated by semicolon (;) that can be used instead of phone_id
application_id:
number
OptionalThe application ID
application_name:
string
OptionalThe application name that can be used instead of application_id
is_bound_to_application:
boolean
OptionalIs a phone bound to an application
phone_template:
string
OptionalThe phone number start to filter
country_code:
stringlist
OptionalThe country code list separated by semicolon (;)
phone_category_name:
string
OptionalThe phone category name. See the GetPhoneNumberCategories method
canceled:
boolean
OptionalThe flag of the canceled (deleted) subscription to filter
deactivated:
boolean
OptionalThe flag of the deactivated (frozen) subscription to filter
auto_charge:
boolean
OptionalThe auto_charge flag to filter
from_phone_next_renewal:
date
OptionalThe UTC 'from' date filter in format: YYYY-MM-DD
to_phone_next_renewal:
date
OptionalThe UTC 'to' 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
to_phone_purchase_date:
timestamp
OptionalThe UTC 'to' date filter in 24-h format: YYYY-MM-DD HH:mm:ss
child_account_id:
intlist
OptionalThe child account ID list separated by semicolon (;). Use the 'all' value to select all child accounts
children_phones_only:
boolean
OptionalDefaults on: falseSet true to get the children phones only
verification_name:
string
OptionalThe required account verification name to filter
verification_status:
stringlist
OptionalThe account verification status list separated by semicolon (;). The following values are possible: REQUIRED, IN_PROGRESS, VERIFIED
from_unverified_hold_until:
date
OptionalUnverified phone hold until the date (from …) in format: YYYY-MM-DD
to_unverified_hold_until:
date
OptionalUnverified phone hold until the date (… to) in format: YYYY-MM-DD
can_be_used:
boolean
OptionalUnverified account can use the phone
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'
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'
count:
number
OptionalDefaults on: 100The max returning record count
offset:
number
OptionalDefaults on: 0The first N records will be skipped in the output
phone_region_name:
stringlist
OptionalThe region names list separated by semicolon (;)
rule_id:
intlist
OptionalThe rule ID list separated by semicolon (;)
rule_name:
stringlist
OptionalThe rule names list separated by semicolon (;). Can be used only if application_id or application_name is specified
is_bound_to_rule:
boolean
OptionalNumber is bound to some rule
Returns
result:
Phone numbers info
total_count:
number
The total found phone count
count:
number
The returned phone count
GetNewPhoneNumbers
Gets the new phone numbers.
To call this method, make sure your service account has one of the following roles:
Parameters
country_code:
string
The country code
phone_category_name:
string
The phone category name. See the GetPhoneNumberCategories function
country_state:
string
OptionalThe country state. See the GetPhoneNumberCategories and GetPhoneNumberCountryStates functions
phone_region_id:
number
The phone region ID. See the GetPhoneNumberRegions method
count:
number
OptionalDefaults on: 20The max returning record count
offset:
number
OptionalDefaults on: 0The first N records will be skipped in the output
Returns
result:
total_count:
number
The total found phone count
count:
number
The returned 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 semicolon (;)
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'
locale:
string
OptionalThe 2-letter locale code. Supported values are EN, RU
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
phone_category_name:
string
The phone category name. See the GetPhoneNumberCategories function
country_state:
string
OptionalThe country state code (example: AL, CA, … )
Returns
GetPhoneNumberRegions
Get the country regions of the phone numbers. The response will also contain 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
phone_category_name:
string
The phone category name. See the GetPhoneNumberCategories method
country_state:
string
OptionalThe country state code (example: AL, CA, … )
omit_empty:
boolean
OptionalDefaults on: trueSet to 'false' to show all the regions (with and without phone numbers in stock)
phone_region_id:
number
OptionalThe phone region ID to filter
phone_region_name:
string
OptionalThe phone region name to filter
phone_region_code:
string
OptionalThe region phone prefix to filter
locale:
string
OptionalThe 2-letter locale code. Supported values are EN, RU
Returns
GetActualPhoneNumberRegion
Get actual info on the country region of the phone numbers. The response will also contain the info about multiple numbers subscription for the child accounts.
Parameters
country_code:
string
The country code
phone_category_name:
string
The phone category name. See the GetPhoneNumberCategories method
country_state:
string
OptionalThe country state code (example: AL, CA, … )
phone_region_id:
number
The phone region ID to filter
locale:
string
OptionalThe 2-letter locale code. Supported values are EN, RU
Returns
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 semicolon (;) to filter
Returns
result:
[string]
Array of country codes