2017 © Pedro Peláez
 

library nexmo

Nexmo API client built with Guzzle Web Service descriptions

image

fillup/nexmo

Nexmo API client built with Guzzle Web Service descriptions

  • Friday, April 28, 2017
  • by fillup
  • Repository
  • 2 Watchers
  • 24 Stars
  • 10,925 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 14 Forks
  • 1 Open issues
  • 8 Versions
  • 2 % Grown

The README.md

nexmo

PHP client to interact with Nexmo APIs, (*1)

This library was developed as part of a tutorial, you can go through the tutorial starting at:, (*2)

Creating a PHP Nexmo API Client using Guzzle Web Service Client – Part 1, (*3)

This library now covers all RESTful outbound APIs from Nexmo, so whether you're interested in the tutorial or not you're welcome to use the library for integration with Nexmo., (*4)

Install

Installation is easy with composer. Just add "fillup/nexmo": "dev-master" to your composer.json require section and update., (*5)

Usage / Example

All classes are in the Nexmo\ namespce:, (*6)

use Nexmo\Developer;
use Nexmo\Insight;
use Nexmo\Sms;
use Nexmo\Verify;
use Nexmo\Voice;

/**
 * Load config, expecting an array with:
 * api_key, api_secret, to, from, text
 */
$config = include __DIR__.'/../../config-local.php';

/**
 * Get an SMS client object
 */
$sms = new Sms($config);

/**
 * Send a message
 */
$results = $sms->send([
    'from' => $config['from'],
    'to' => $config['to'],
    'text' => $config['text'],
]);

/**
 * Dump out results
 */
print_r($results);
// Array
// (
//    [statusCode] => 200
//    [message-count] => 1
//    [messages] => Array
// (
//    [0] => Array
//    (
//        [to] => 14085559876
//                    [message-id] => 0300000071BCAA3C
//                    [status] => 0
//                    [remaining-balance] => 15.23280000
//                    [message-price] => 0.00480000
//                    [network] => US-VOIP
//                )
// 
//        )
// 
// )

All API calls require an api_key and api_secret. Best practice would be to keep this out of your code an in some sort of configuration file or environment variable that does not go into your source code. Just pass an array with keys for api_key and api_secret to the constructor of each class like in the example above., (*7)

The Versions

28/04 2017

dev-develop

dev-develop

Nexmo API client built with Guzzle Web Service descriptions

  Sources   Download

MIT

The Requires

 

28/04 2017

2.0

2.0.0.0

Nexmo API client built with Guzzle Web Service descriptions

  Sources   Download

MIT

The Requires

 

28/04 2017

dev-master

9999999-dev

Nexmo API client built with Guzzle Web Service descriptions

  Sources   Download

MIT

The Requires

 

28/07 2016

1.0.4

1.0.4.0

Nexmo API client built with Guzzle Web Service descriptions

  Sources   Download

MIT

The Requires

 

28/07 2016

1.0.3

1.0.3.0

Nexmo API client built with Guzzle Web Service descriptions

  Sources   Download

MIT

The Requires

 

19/05 2016

1.0.2

1.0.2.0

Nexmo API client built with Guzzle Web Service descriptions

  Sources   Download

MIT

The Requires

 

22/04 2016

1.0.1

1.0.1.0

Nexmo API client built with Guzzle Web Service descriptions

  Sources   Download

MIT

The Requires

 

29/03 2016

1.0.0

1.0.0.0

Nexmo API client built with Guzzle Web Service descriptions

  Sources   Download

MIT

The Requires