A php client of the Elibom REST API. The full API reference is here
cURL (apt-get install php5-curl)
-
Install
pear install https://github.com/elibom/elibom-php-codeigniter/archive/master.zip
-
Modify credentials in the file elibom.php located in application/config:
// user : email de elibom // token: codigo Api de elibom $config['user'] = 'xxxxxxxxxxx'; $config['token'] = 'xxxxxxxxxxx';
Note: You can find your api password at http://www.elibom.com/api-password (make sure you are logged in).
-
Create the controller in the folder application/controllers:
class Sms extends CI_Controller { public function __construct() { parent::__construct(); $this->load->library('elibom'); } public function index() { $sms = $this->elibom->sendMessage('number', 'text'); }
Elibom's library (application/libraries) exposes the following methods:
- Send SMS
- Schedule SMS
- Show Delivery
- List Scheduled SMS Messages
- Show Scheduled SMS Message
- Cancel Scheduled SMS Message
- List Users
- Show User
- Show Account
//Return string
$deliveryId = $this->elibom->sendMessage('3201111111','PHP - TEST');//Return json object
$delivery = $this->elibom->getDelivery('<delivery_token>');//Return string
$scheduleId = $this->elibom->scheduleMessage('3201111111', 'Test PHP', 'dd/MM/yyyy hh:mm');//Return json array
$scheduledMessages = $this->elibom->getScheduledMessages();//Return json object
$schedule = $this->elibom->getScheduledMessage('<schedule_id>');//Void
$this->elibom->unscheduleMessage('<schedule_id>');//Return json array
$users = $this->elibom->getUsers();
foreach($users as $user) {
echo json_encode($user);
}//Return json object
$user = $this->elibom->getUser('<user_id>');//Return json object
$account = $this->elibom->getAccount();Special thanks to the developers who wrote this library:
- Nolberto Vilchez Moreno
- [Renzo Aliaga Rios]