Skip to content

Latest commit

 

History

History

console-number-search

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Telnyx-PHP Available Number Searching

Telnyx

Sample Console App demonstrating Telnyx-PHP Available number Searching

Documentation & Tutorial

The full documentation and tutorial is available on developers.telnyx.com

Pre-Reqs

You will need to set up:

What you can do

  • Search by areacode or NPA and get a list of response

Usage

The following environmental variables need to be set

Variable Description
TELNYX_API_KEY Your Telnyx API Key
TELNYX_PUBLIC_KEY Your Telnyx Public Key
TELNYX_APP_PORT Defaults to 8000 The port the app will be served (if applicable)

.env file

This app uses the excellent phpenv package to manage environment variables.

Make a copy of .env.sample and save as .env and update the variables to match your creds.

TELNYX_API_KEY=
TELNYX_PUBLIC_KEY=
TENYX_APP_PORT=8000

Install

Run the following commands to get started

$ git clone https://github.com/d-telnyx/demo-php-telnyx.git
$ cd console-number-search
$ composer install

Run

Run the PHP script php app.php from the command line and answer the prompt for area code / NPA

$ php app.php
Which NPA (area code) would you like to get NXX counts?: 919
Array
(
    [335] => 2
    [646] => 5
    [887] => 6
    [944] => 2
)