ebulk-php
, (*1)
, (*2)
ebulk-php is a library for using the Ebulk SMS API from PHP., (*3)
This library is first and designed to make Ebulk API consumption seamless., (*4)
Installation
To install using composer, (*5)
composer require aladeusi/ebulk-php=dev-master
Navigate to your root directory and update composer to install ebulk-php dependencies, (*6)
composer update
Usage
Import Classes
Require composer autoload file and import Initialize, SendMessage and Response classes, (*7)
require ('vendor/autoload.php');
use EbulkSMS\Authentication\Initialize;
use EbulkSMS\Response\Response;
use EbulkSMS\Request\SendSMS;
Initialize the Libary
First you initialize the library with your API key. This key can be retrived from your evulk account dashboard, (*8)
$Initialize=new Initialize([
'Key'=>'YourAPIKey',
'Username'=>'YourEbulkUserName'
]);
Send SMS
You can either send sms in JSON format or XML format., (*9)
SendSMS::sendWithJSON(['SenderName'=>'YourCustomSenderName',
'Recipients'=>'RecipientsPhoneNumbersSeparatedWithComma',
'Message'=>'YourCustomMessage'
]);
SendSMS::sendWithXML(['SenderName'=>'YourCustomSenderName',
'Recipients'=>'RecipientsPhoneNumbersSeparatedWithComma',
'Message'=>'YourCustomMessage'
]);
Get Response Message and Code
Response Code
Response::$getResposeCode
Response Success Message
Response::$getSuccessMessage
Response Error Message
Response::$getErrorMessage