PHP Classes

Minimal Twilio PHP API Send SMS: Send SMS messages using the Twilio API

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 242 All time: 8,018 This week: 524Up
Version License PHP version Categories
twiliominimal 1.0.0MIT/X Consortium ...7Wireless and Mobile, Web services, PHP 7
Description 

Author

This package can be used to send SMS messages using the Twilio API.

It can send HTTP requests to the Twilio API Web server to send a given text to a recipient with a given phone number from a given sender number.

A separate class can be used to send SMS messages with a minimal amount of calling code.

Innovation Award
PHP Programming Innovation award nominee
April 2020
Number 8
Twilio is a popular service for sending SMS messages and providing other telephone base services.

This package provide a PHP API to send SMS messages using the Twilio API using just two lines of code.

Manuel Lemos
Picture of Niko Peikrishvili
  Performance   Level  
Name: Niko Peikrishvili <contact>
Classes: 7 packages by
Country: Georgia Georgia
Age: ???
All time rank: 31964 in Georgia Georgia
Week rank: 288 Up1 in Georgia Georgia Up
Innovation award
Innovation award
Nominee: 4x

Recommendations

Example

<?php
require __DIR__ . '/../vendor/autoload.php';

use
NikoPeikrishvili\TwilioMinimal\TwilioConfig;
use
NikoPeikrishvili\TwilioMinimal\TwilioMinimal;

$config = new TwilioConfig();
$config->setSenderNumber("");
$config->setClientSid("");
$config->setAuthToken("");

$twilio = new TwilioMinimal($config);

$twilio->send("+00000000000", "Messge body");


Details

TwilioMinimal

Build Status Coverage

Minimal Twilio package just for sending SMS Messages

Supported PHP Versions

  • 7.1
  • 7.2
  • 7.3
  • 7.4

Instalation Via Composer:

TwilioMinimal is available on Packagist as the nikopeikrishvili/twiliominimal package:

composer require nikopeikrishvili/twiliominimal

Quickstart

Send an SMS

<?php
require __DIR__ . '/vendor/autoload.php';

use NikoPeikrishvili\TwilioMinimal\TwilioConfig;
use NikoPeikrishvili\TwilioMinimal\TwilioMinimal;

$config = new TwilioConfig();
// Sender phone number 
$config->setSenderNumber("");
// Client SID
$config->setClientSid("");
// Client Auth Token
$config->setAuthToken("");

$twilio = new TwilioMinimal($config);

$twilio->send("+00000000000", "Message body");

Testing

composer test

Coding style checks

composer cs


  Files folder image Files (14)  
File Role Description
Files folder imageExamples (1 file)
Files folder imagesrc (2 files, 1 directory)
Files folder imagetests (2 files)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpcs.xml Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Read me

  Files folder image Files (14)  /  Examples  
File Role Description
  Accessible without login Plain text file sendMessage.php Example Example script

  Files folder image Files (14)  /  src  
File Role Description
Files folder imageExceptions (3 files)
  Plain text file TwilioConfig.php Class Class source
  Plain text file TwilioMinimal.php Class Class source

  Files folder image Files (14)  /  src  /  Exceptions  
File Role Description
  Plain text file InvalidTextSizeException.php Class Class source
  Plain text file InvalidTwilioConfigException.php Class Class source
  Plain text file UnableToSendMessageException.php Class Class source

  Files folder image Files (14)  /  tests  
File Role Description
  Plain text file TwilioConfigTest.php Class Class source
  Plain text file TwilioMinimalTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:242
This week:0
All time:8,018
This week:524Up