Madraka / ultimate-sms-api

Ultimate SMS API is build for Ultimate SMS - Bulk SMS Application For Marketing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Latest Stable Version License GitHub issues GitHub stars

Ultimate SMS API

Ultimate SMS API is build for Ultimate SMS - Bulk SMS Application For Marketing

Prerequisites

To run Ultimate SMS API you have to install Ultimate SMS Application on your server. For more details please visit: Ultimate SMS

php >=5.6
Ultimate SMS - Bulk SMS Application For Markting

Installing

Via Composer

composer require shamim/ultimate-sms-api 

And Via Bash

git clone https://github.com/akasham67/ultimate-sms-api.git

Usage

Step 1:

If install Ultimate SMS API using Git Clone then load your Ultimate SMS API Class file and Use namespace.

require_once 'src/Class_Ultimate_SMS_API.php';
use UltimateSMS\UltimateSMSAPI;

If install Ultimate SMS API using Composer then Require/Include autoload.php file in the index.php of your project or whatever file you need to use Ultimate SMS API classes:.

require 'vendor/autoload.php';
use UltimateSMS\UltimateSMSAPI;

Step 2:

set your API_KEY from https://mywebhost.com/sms-api/info (your application install url)

$api_key = 'YWRtaW46YWRtaW4ucGFzc3dvcmQ=';

Step 3:

Change the from number below. It can be a valid phone number or a String

$from = '8801721000000';

Step 4:

the number we are sending to - Any phone number

$destination = '8801810000000';

You have to must include Country code at beginning of the phone number.

Step 5:

Replace your Install URL like https://mywebhost.com/sms/api with https://ultimatesms.coderpixel.com/demo/ sms/api is mandatory on your install url

$url = 'https://ultimatesms.coderpixel.com/demo/sms/api';

// SMS Body

$sms = 'test message from Ultimate SMS';

// Unicode SMS

$unicode = '0'; //For plain message
$unicode = '1'; //For Unicode message

// Create SMS Body for request

$sms_body = array(
    'api_key' => $api_key,
    'to' => $destination,
    'from' => $from,
    'sms' => $sms,
    'unicode' => $unicode,
);

Step 6:

Instantiate a new Ultimate SMS API request

$client = new UltimateSMSAPI();

Send SMS

Finally send your sms through Ultimate SMS API

$response = $client->send_sms($sms_body, $url);

Get Inbox

Get your all message

$get_inbox=$client->get_inbox($api_key,$url);

Get Balance

Get your account balance

$get_balance=$client->check_balance($api_key,$url);

Response

Ultimate SMS API return response with json format, like:

{"code":"ok","message":"Successfully Send"}

Status Code

Status Message
ok Successfully Send
100 Bad gateway requested
101 Wrong action
102 Authentication failed
103 Invalid phone number
104 Phone coverage not active
105 Insufficient balance
106 Invalid Sender ID

Authors

  • Abul Kashem Shamim - Initial work - akasham67

About

Ultimate SMS API is build for Ultimate SMS - Bulk SMS Application For Marketing


Languages

Language:PHP 100.0%