Nexmo PHP client 1.0.0 Release

Announcing v1.0.0 of the Nexmo PHP Client Library!

Published August 29, 2017 by Michael Heap

After a heroic effort from Tim and some work from Michael to get it over the line, we’re proud to announce that we’ve just tagged version 1.0 of the Nexmo PHP client library – it’s just one composer require away!

The Tech

Built on top of Zend Diactoros and Guzzle, it’s a PSR-7 compliant HTTP client for the Nexmo API. Initially, it supports our core services such as SMS, voice calls, Verify and virtual number provisioning and we’ll be working to add coverage for the remaining products over the next month.

Whether you’re a developer that loves entities and type hints, or if you’d rather pass everything around as an array, the library has something for you. Each of our entities implements ArrayAccess to read data and accepts arrays as parameters when creating and updating entities.

Examples

Interacting with the Nexmo API is especially easy when using our PHP client library. You can send an SMS, make a voice call and use Verify to validate a user’s number, all in less than ten lines of code each!

How to send an SMS

How to make a voice call

How to use 2FA to verify a user’s identity

Bonus points

If you’re a Laravel user, we have an extra special treat for you. As well as our standalone library, we have nexmo/laravel which is a Laravel service provider for the Nexmo PHP client. If you’re running Laravel 5.5 or above, the library will automatically register itself as a provider, allowing you to use the facade straight away.

Once you’ve installed nexmo/laravel and configured your API key and secret via .env, sending an SMS is as simple as this:

Get involved!

Whether you’ve used Nexmo via SMS notifications in Laravel (yep, we power those!), you’ve built an enormous logistics system or anything in between; we’d love to hear about it. Even better if it’s open source and we can point to it as an example of how to leverage the power of Nexmo to get the job done.

If you’re interested in getting involved in the client library development it’s as easy as finding a use case you have that we don’t support yet and opening an issue. We can work together to spec out and build support in to the client (we’ll even help you write the tests!)

Leave a Reply

Your email address will not be published.