#CuluSMS-php
###PHP Unofficial SDK for CuluSMS API
Via composer:
composer require alexcrisbrito/culusms-php
To use this SDK we need to get the API key from the CuluSMS and create an instance of the main class, here's how:
require './vendor/autoload.php';
use alexcrisbrito\culusms\CuluSms;
$culu = new CuluSms("<API_KEY>");
After this, we can access the API services like this:
$culu->messages->action();
$culu->address_book->action();
$culu->devices->action();
Each of those return an instance of a contract class, where you can execute all the actions you want to.
###Examples #####Refer to the API to see the required and optional parameters
Send a message
$response = $culu->messages->send([
"phone" => "+1 800 208 5331",
"message" => "This is a test message.",
//This is optional
"priority" => 1,
"device" => 1,
"sim" => 1
]);
if ($response->isSuccess()) {
var_dump($response->getData());
}
Create a contact
$response = $culu->address_book->create_contact([
"name" => "Johnny Doe",
"phone" => "+258844276077",
"group" => 2
]);
Get a device info using their id
$response = $culu->devices->get_device(1);
For the other actions for each of the API services just refer to the API Guide on CuluSMS official website
You can contribute emailing me via [email protected] or via pull request.
- Alexandre Brito (Developer)
The MIT License (MIT). Please see License File for more information.