SIGN UP

Managing Phone Numbers

Methods

AttachPhoneNumber

Attach the phone number to the account. To attach the German, Italian phone numbers you should specify the phoneowner* parameters.

Parameters

Returns

Examples

request:

Attach the one US phone number to the account 1.

https://api.voximplant.com/platform_api/AttachPhoneNumber/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&country_code=US&phone_category_name=GEOGRAPHIC&country_state=CA&phone_region_id=1100&phone_count=1

Attach the '74953332211' phone number to the account 1.

https://api.voximplant.com/platform_api/AttachPhoneNumber/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&country_code=RU&phone_category_name=GEOGRAPHIC&phone_region_id=4&phone_number=74953332211

response:

Success

{
    "result": 1,
    "phone_numbers": [
        {
            "phone_id": 12,
            "phone_number": "74953332266"
        },
        {
            "phone_id": 14,
            "phone_number": "74953335599"
        }
    ]
}

The account verification required: RU

{
    "error": {
        "msg": "Account verification required.",
        "code": 281,
        "details": {
            "verification_name": "RU"
        }
    }
}

The overdue account verification in progress.

{
    "error": {
        "msg": "Account verification in progress.",
        "code": 282
    }
}

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.

Parameters

  • Follow link for authentication parameter names and details.

  • phone_id:

    string

    The phone ID list separated by the ';' symbol or the 'all' value.

  • phone_number:

    string

    The phone number list separated by the ';' symbol 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
    Optional

    The rule ID.

  • rule_name:

    string
    Optional

    The rule name that can be used instead of rule_id.

  • bind:

    boolean
    Optional
    Defaults to true

    Bind or unbind?

Returns

  • result:

    number

    1

Examples

request:

Bind the phone 1 to the application 1.

https://api.voximplant.com/platform_api/BindPhoneNumberToApplication/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&phone_id=1&application_id=1

response:

Success

{
    "result": 1
}

DeactivatePhoneNumber

Deactivates the phone number.

Parameters

  • Follow link for authentication parameter names and details.

  • phone_id:

    number

    The phone ID.

  • phone_number:

    string

    The phone number that can be used instead of phone_id.

Returns

  • result:

    number

    1

Examples

request:

Deactivate the phone 1.

https://api.voximplant.com/platform_api/DeactivatePhoneNumber/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&phone_id=1

response:

Success

{
    "result": 1
}

GetActualPhoneNumberRegion

Get actual info the country region of the phone numbers. The response will also contain the info about multiple numbers subscription for the child accounts.

Parameters

  • Follow link for authentication parameter names and details.

  • country_code:

    string

    The country code.

  • phone_category_name:

    string

    The phone category name. See the GetPhoneNumberCategories method.

  • phone_region_id:

    number

    The phone region ID to filter.

Returns

Examples

request:

Get the Germany region of the phone numbers.

https://api.voximplant.com/platform_api/GetActualPhoneNumberRegion/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&country_code=DE&phone_category_name=GEOGRAPHIC&phone_region_id=1

response:

{
    "result": {
        "phone_count": 95,
        "phone_price": 0.5,
        "phone_period": "0-1-0 0:0:0",
        "phone_region_id": 1,
        "phone_region_code": "263",
        "phone_region_name": "AACHEN",
        "multiple_numbers_price": [
            {
                "count": 10,
                "price": 0.4,
                "installation_price": 1
            }
        ],
        "phone_installation_price": 2
    }
}

GetNewPhoneNumbers

Gets the new phone numbers.

Parameters

  • Follow link for authentication parameter names and details.

  • country_code:

    string

    The country code.

  • phone_category_name:

    string

    The phone category name. See the GetPhoneNumberCategories function.

  • country_state:

    string
    Optional

    The country state. See the GetPhoneNumberCategories and GetPhoneNumberCountryStates functions.

  • phone_region_id:

    number

    The phone region ID. See the GetPhoneNumberRegions method.

  • count:

    number
    Optional
    Defaults to 20

    The max returning record count.

  • offset:

    number
    Optional
    Defaults to 0

    The first N records will be skipped in the output.

Returns

  • result:

    [ NewPhoneInfoType ]
  • total_count:

    number

    The total found phone count.

  • count:

    number

    The returned phone count.

Examples

request:

Get the two new fixed Russian phone numbers at max.

https://api.voximplant.com/platform_api/GetNewPhoneNumbers/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&country_code=RU&phone_category_name=GEOGRAPHIC&phone_region_id=1&count=2

response:

{
    "count": 2,
    "result": [
        {
            "phone_id": 10,
            "phone_price": 0.45,
            "phone_number": "74957893798",
            "phone_period": "0-1-0 0:0:0",
            "phone_country_code": "RU",
            "phone_category_name": "GEOGRAPHIC",
            "phone_installation_price": 10.2
        },
        {
            "phone_id": 12,
            "phone_price": 0.5,
            "phone_number": "78332606030",
            "phone_period": "0-1-0 0:0:0",
            "phone_country_code": "RU",
            "phone_category_name": "GEOGRAPHIC",
            "phone_installation_price": 11.3
        }
    ],
    "total_count": 400
}

GetPhoneNumberCategories

Gets the phone number categories.

Parameters

  • Follow link for authentication parameter names and details.

  • country_code:

    string
    Optional

    The country code.

  • sandbox:

    string
    Optional

    Flag allows you to display phone number categories only of the sandbox, real or all .The following values are possible: 'all', 'true', 'false'.

Returns

Examples

request:

Get the all phone number categories.

https://api.voximplant.com/platform_api/GetPhoneNumberCategories/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac

Get the phone number categories in Russia.

https://api.voximplant.com/platform_api/GetPhoneNumberCategories/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&country_code=RU

response:

{
    "result": [
        {
            "country_code": "RU",
            "phone_prefix": "7",
            "phone_categories": [
                {
                    "country_has_states": false,
                    "phone_category_name": "GEOGRAPHIC"
                },
                {
                    "country_has_states": false,
                    "phone_category_name": "MOBILE"
                }
            ],
            "can_list_phone_numbers": true
        },
        {
            "country_code": "US",
            "phone_prefix": "1",
            "phone_categories": [
                {
                    "country_has_states": true,
                    "phone_category_name": "GEOGRAPHIC"
                },
                {
                    "country_has_states": false,
                    "phone_category_name": "TOLLFREE"
                }
            ],
            "can_list_phone_numbers": false
        }
    ]
}

GetPhoneNumberCountryStates

Gets the phone number country states.

Parameters

  • Follow link for authentication parameter names and details.

  • country_code:

    string

    The country code.

  • phone_category_name:

    string

    The phone category name. See the GetPhoneNumberCategories function.

  • country_state:

    string
    Optional

    The country state code (example: AL, CA, ... ).

Returns

Examples

request:

Get the USA states.

https://api.voximplant.com/platform_api/GetPhoneNumberCountryStates/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&country_code=US&phone_category_name=GEOGRAPHIC

Get the AL (Alabama) state info.

https://api.voximplant.com/platform_api/GetPhoneNumberCountryStates/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&country_code=US&phone_category_name=GEOGRAPHIC&country_state=AL

response:

{
    "result": [
        {
            "country_state": "AL",
            "country_state_name": "Alabama"
        },
        {
            "country_state": "CA",
            "country_state_name": "California"
        }
    ]
}

GetPhoneNumberRegions

Get the country regions of the phone numbers. The response will also contain the info about multiple numbers subscription for the child accounts.

Parameters

  • Follow link for authentication parameter names and details.

  • country_code:

    string

    The country code.

  • phone_category_name:

    string

    The phone category name. See the GetPhoneNumberCategories method.

  • country_state:

    string
    Optional

    The country state code (example: AL, CA, ... ).

  • omit_empty:

    boolean
    Optional
    Defaults to true

    Set to 'false' to show the all regions (with and without phone numbers in stock).

  • phone_region_id:

    number
    Optional

    The phone region ID to filter.

  • phone_region_name:

    string
    Optional

    The phone region name to filter.

  • phone_region_code:

    string
    Optional

    The region phone prefix to filter.

Returns

Examples

request:

Get the Russian regions of the phone numbers.

https://api.voximplant.com/platform_api/GetPhoneNumberRegions/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&country_code=RU&phone_category_name=GEOGRAPHIC

response:

{
    "result": [
        {
            "phone_count": 1123,
            "phone_price": 0.45,
            "phone_period": "0-1-0 0:0:0",
            "phone_region_id": 1,
            "phone_region_code": "499",
            "phone_region_name": "Moscow",
            "verification_status": "REQUIRED",
            "required_verification": "RU",
            "multiple_numbers_price": [
                {
                    "count": 10,
                    "price": 0.4,
                    "installation_price": 10
                }
            ],
            "phone_installation_price": 10.2
        },
        {
            "phone_count": 95,
            "phone_price": 0.5,
            "phone_period": "0-1-0 0:0:0",
            "phone_region_id": 3,
            "phone_region_code": "383",
            "phone_region_name": "Novosibirsk",
            "multiple_numbers_price": [],
            "phone_installation_price": 2
        }
    ]
}

GetPhoneNumbers

Gets the account phone numbers.

Parameters

  • Follow link for authentication parameter names and details.

  • phone_id:

    number
    Optional

    The particular phone ID to filter

  • application_id:

    number
    Optional

    The application ID.

  • application_name:

    string
    Optional

    The application name that can be used instead of application_id.

  • is_bound_to_application:

    boolean
    Optional

    Is a phone bound to an application.

  • phone_template:

    string
    Optional

    The phone number start to filter

  • country_code:

    string
    Optional

    The country code list separated by the ';' symbol.

  • phone_category_name:

    string
    Optional

    The phone category name. See the GetPhoneNumberCategories method.

  • canceled:

    boolean
    Optional

    The flag of the canceled (deleted) subscription to filter.

  • deactivated:

    boolean
    Optional

    The flag of the deactivated (frozen) subscription to filter.

  • auto_charge:

    boolean
    Optional

    The auto_charge flag to filter.

  • from_phone_next_renewal:

    string
    Optional

    The UTC from 'phone_next_renewal' date filter in format: YYYY-MM-DD

  • to_phone_next_renewal:

    string
    Optional

    The UTC to 'phone_next_renewal' date filter in format: YYYY-MM-DD

  • from_phone_purchase_date:

    string
    Optional

    The UTC from 'phone_purchase_date' date filter in 24-h format: YYYY-MM-DD HH:mm:ss

  • to_phone_purchase_date:

    string
    Optional

    The UTC to 'phone_purchase_date' date filter in 24-h format: YYYY-MM-DD HH:mm:ss

  • child_account_id:

    string
    Optional

    The child account ID list separated by the ';' symbol or the 'all' value.

  • children_phones_only:

    boolean
    Optional
    Defaults to false

    Set true to get the children phones only.

  • verification_name:

    string
    Optional

    The required account verification name to filter.

  • verification_status:

    string
    Optional

    The account verification status list separated by the ';' symbol. The following values are possible: REQUIRED, IN_PROGRESS, VERIFIED

  • from_unverified_hold_until:

    string
    Optional

    Unverified phone hold until the date (from ...) in format: YYYY-MM-DD

  • to_unverified_hold_until:

    string
    Optional

    Unverified phone hold until the date (... to) in format: YYYY-MM-DD

  • can_be_used:

    boolean
    Optional

    Can the unverified account use the phone?

  • order_by:

    string
    Optional

    The 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
    Optional

    Flag 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
    Optional
    Defaults to 100

    The max returning record count.

  • offset:

    number
    Optional
    Defaults to 0

    The first N records will be skipped in the output.

  • phone_region_name:

    string
    Optional

    The region names list separated by the ';' symbol.

  • rule_id:

    string
    Optional

    The rule ID list separated by the ';' symbol.

  • rule_name:

    string
    Optional

    The rule names list separated by the ';' symbol. Can be used only if application_id or application_name is specified.

  • is_bound_to_rule:

    boolean
    Optional

    Is a number bound to any rule?

Returns

  • total_count:

    number

    The total found phone count.

  • count:

    number

    The returned phone count.

Examples

request:

Get the two attached phone numbers.

https://api.voximplant.com/platform_api/GetPhoneNumbers/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&count=2

response:

{
    "count": 2,
    "result": [
        {
            "canceled": false,
            "phone_id": 1,
            "auto_charge": true,
            "can_be_used": false,
            "deactivated": false,
            "phone_price": 0.45,
            "phone_number": "74957893798",
            "category_name": "GEOGRAPHIC",
            "phone_country_code": "RU",
            "phone_next_renewal": "2013-11-10",
            "phone_purchase_date": "2013-10-10 04:02:47",
            "verification_status": "REQUIRED",
            "required_verification": "RU",
            "unverified_hold_until": "2013-10-24"
        },
        {
            "canceled": false,
            "phone_id": 3,
            "auto_charge": false,
            "can_be_used": true,
            "deactivated": true,
            "phone_price": 0.4,
            "phone_number": "12055645250",
            "category_name": "GEOGRAPHIC",
            "application_id": 1,
            "application_name": "app1.myaccount191.voximplant.com",
            "phone_country_code": "US",
            "phone_next_renewal": "2013-09-28",
            "phone_purchase_date": "2013-08-28 14:13:36"
        }
    ],
    "total_count": 4
}

SetPhoneNumberInfo

Configure the phone number.

Parameters

  • Follow link for authentication parameter names and details.

  • phone_id:

    string

    The phone ID list separated by the ';' symbol or the 'all' value.

  • phone_number:

    string

    The phone number that can be used instead of phone_id.

  • auto_charge:

    boolean

    Is auto charge enable?

Returns

  • result:

    number

    1

Examples

request:

Enable the auto charging.

https://api.voximplant.com/platform_api/SetPhoneNumberInfo/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&phone_id=1&auto_charge=true

response:

Success

{
    "result": 1
}