Buscar Numbers disponibles

Esta página le muestra cómo buscar mediante programación los números que están disponibles para su compra.

También puede buscar los Numbers disponibles en línea, utilizando la función panel de control para desarrolladores o desde la línea de comandos, utilizando la opción CLI de Vonage.

Sustituya las siguientes variables del código de ejemplo por sus propios valores:

ClaveDescripción
VONAGE_API_KEY

Your Vonage API key (see it on your dashboard).

VONAGE_API_SECRET

Your Vonage API secret (also available on your dashboard).

COUNTRY_CODE

The two digit country code for the number. For example: GB for the United Kingdom

VONAGE_NUMBER_TYPE

The type of number: landline, mobile-lvn or landline-toll-free

VONAGE_NUMBER_FEATURES

The capabilities of the number: SMS, VOICE or SMS,VOICE for both

NUMBER_SEARCH_CRITERIA

The filter criteria. For example, numbers containing 234.

NUMBER_SEARCH_PATTERN

Where the NUMBER_SEARCH_CRITERIA should appear in the number:

  • 0 - At the beginning of the number
  • 1- Anywhere in the number
  • 2 - At the end of the number

Escriba el código

Añada lo siguiente a search-numbers.sh:

curl "https://rest.nexmo.com/number/search?api_key=$VONAGE_API_KEY&api_secret=$VONAGE_API_SECRET&country=$COUNTRY_CODE&type=$VONAGE_NUMBER_TYPE&features=$VONAGE_NUMBER_FEATURES&pattern=$NUMBER_SEARCH_CRITERIA&search_pattern=$NUMBER_SEARCH_PATTERN"

Ver fuente completa

Ejecute su código

Guarde este archivo en su máquina y ejecútelo:

sh search-numbers.sh

Ver también