unimtx / uni-sdk
The official Unimatrix SDK for PHP.
Requires
- php: >=7.0
- ext-curl: *
README
The Unimatrix PHP SDK provides convenient access to integrate communication capabilities into your PHP applications using the Unimatrix HTTP API. The SDK provides support for sending SMS, 2FA verification, and phone number lookup.
Getting started
Before you begin, you need an Unimatrix account. If you don't have one yet, you can sign up for an Unimatrix account and get free credits to get you started.
Documentation
Check out the documentation at unimtx.com/docs for a quick overview.
Installation
Using Composer is the recommended way to install the Unimatrix SDK for PHP, which is available on Packagist.
Run the following command to add unimtx/uni-sdk
as a dependency to your project:
composer require unimtx/uni-sdk
Usage
The following example shows how to use the Unimatrix PHP SDK to interact with Unimatrix services.
Send SMS
Send a text message to a single recipient.
use Uni\UniClient; use Uni\UniException; $client = new UniClient([ 'accessKeyId' => 'your access key id', 'accessKeySecret' => 'your access key secret' ]); try { $resp = $client->messages->send([ 'to' => 'your phone number', // in E.164 format 'signature' => 'your sender name', 'content' => 'Your verification code is 2048.' ]); var_dump($resp->data); } catch (UniException $e) { print_r($e); }
Reference
Other Unimatrix SDKs
To find Unimatrix SDKs in other programming languages, check out the list below:
License
This library is released under the MIT License.