aladeusi/ebulk-php

ebulk-php is a library for using the Ebulk SMS API from PHP. This library is first and designed to make Ebulk API consumption seamless.

dev-master 2018-03-21 00:40 UTC

This package is not auto-updated.

Last update: 2024-04-14 02:18:53 UTC


README

Build Status license

Packagist

ebulk-php is a library for using the Ebulk SMS API from PHP.

This library is first and designed to make Ebulk API consumption seamless.

Installation

To install using composer

composer require aladeusi/ebulk-php=dev-master

Navigate to your root directory and update composer to install ebulk-php dependencies

composer update

Usage

Import Classes

Require composer autoload file and import Initialize, SendMessage and Response classes

    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

$Initialize=new Initialize([
    'Key'=>'YourAPIKey',
    'Username'=>'YourEbulkUserName'
    ]);

Send SMS

You can either send sms in JSON format or XML format.

In JSON Format

    SendSMS::sendWithJSON(['SenderName'=>'YourCustomSenderName',
            'Recipients'=>'RecipientsPhoneNumbersSeparatedWithComma',
            'Message'=>'YourCustomMessage'
        ]);

In XML Format

    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