Overview
Telecom Lookup Tools

PHP

The Teli PHP Helper Library

The Teli PHP SDK makes it easy to interact with the Teli API from your PHP application. The most recent version of the Teli PHP SDK can be found on Packagist. The Teli SDK requires PHP version 5.6 or higher.

The recommended method for installing the SDK is via Composer. You can add the PHP SDK to your composer.json file with the require command:

composer require teli/teli-php

If you're using Composer in an environment that doesn't handle autoloading, you can require the autoload file from the "vendor" directory created by Composer if you used the install command above. Here is a basic example of using the SDK to send a text message.

<?php
// Required if your environment does not handle autoloading
require __DIR__ . '/vendor/autoload.php';
use Teli\Teli;
$callApiSIDToken = "TELI_CALL_API_SID_TOKEN"; // Your Call API SID Token from https://control.teli.net
$apiToken = "TELI_API_TOKEN"; // Your API Token from https://control.teli.net
$teli = new Teli($callApiSIDToken, $apiToken);
$response = $teli->sms->send([
// A Teli phone number you purchased
'source' => 2674935581,
// the number you'd like to send the message to
'destination' => 7205551212,
// the body of the text message you'd like to send
'message' => 'Hi there'
]);