2017 © Pedro Peláez
 

library nexmo-php-lib

image

andreasanta/nexmo-php-lib

  • Thursday, June 23, 2016
  • by avegao
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 110 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Nexmo-PHP-lib

Sending SMS via the Nexmo SMS gateway., (*1)

Quick Examples

  1. Sending an SMS
$sms = new NexmoMessage('account_key', 'account_secret');
$sms->sendText( '+447234567890', 'MyApp', 'Hello world!' );
  1. Recieving SMS
$sms = new NexmoMessage('account_key', 'account_secret');
if ($sms->inboundText()) {
    $sms->reply('You said: ' . $sms->text);
}
  1. Recieving a message receipt
$receipt = new NexmoReceipt();
if ($receipt->exists()) {
    switch ($receipt->status) {
        case $receipt::STATUS_DELIVERED:
             // The message was delivered to the handset!
             break;

         case $receipt::STATUS_FAILED:
         case $receipt::STATUS_EXPIRED:
             // The message failed to be delivered
             break;
    }
}
  1. List purchased numbers on your account
$account = new NexmoAccount('account_key', 'account_secret');
$numbers = $account->numbersList();

Most Frequent Issues

Sending a message returns false.

This is usually due to your webserver unable to send a request to Nexmo. Make sure the following are met:, (*2)

  1. Either CURL is enabled for your PHP installation or the PHP option allow_url_fopen is set to 1 (default)., (*3)

  2. You have no firewalls blocking access to rest.nexmo.com/sms/json on port 443., (*4)

The Versions

23/06 2016

dev-master

9999999-dev

  Sources   Download

The Requires

  • php >=5.3.0