Skip to content

gosms-ge/GoSMS.GE-API

Repository files navigation

Contributing contributions welcome

PHP version GitHub version

GoSMS API

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

Prerequisites

To run GoSMS API you have to install GoSMS Application on your server.

php >=5.6
GoSMS - Bulk SMS Application For Markting

Installing

Via Composer

composer require levart/go-sms-api

And Via Bash

git clone https://github.com/gosms-ge/GoSMS.GE-API.git

Usage

Step 1:

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

require_once 'src/Class_Go_SMS_API.php';
use GoSMS\GoSMSAPI;

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

require 'vendor/autoload.php';
use GoSMS\GoSMSAPI;

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 is mandatory on your install url

// SMS Body

$sms = 'test message from GoSMS';

// 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 GoSMS API request

$client = new GoSMSAPI();

Send SMS

Finally send your sms through GoSMS 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

GoSMS 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

  • Levan Jmukhadze - Initial work - levart

Releases

No releases published

Packages

No packages published

Languages