PHP Bongatech API

0.7.2 2023-09-25 21:16 UTC

This package is auto-updated.

Last update: 2025-02-26 00:36:54 UTC


README

Latest Version on Packagist Software License Total Downloads

This PHP SDK provides convenient methods for consuming BongaTech API.

Documentation

BongaTech API Documentation can be found at https://bulk.bongatech.co.ke/docs

Install

Via Composer (recommended)

$ composer require bongatech/api

Via Download

1. Clone or Download this Repo.
2. run `composer install` in the root of the project

Usage

Sending a Message

Detailed samples can be obtained from examples folder

<?php
//include if your project wasent initialized with composer prior to downloading.
//ensure path to vendor is correct
require_once 'vendor/autoload.php';

use BongaTech\Api\BongaTech;
use BongaTech\Api\Models\Sms;

$instance = new BongaTech("TOKEN_string");

//create an Sms Object
$sms= new Sms("BONGATECH", "0716079675", "Test Message 1", "101");

//send Sms object
$response = $instance->sendSMS($sms);

var_dump($response);

Sending Messages in batches

<?php
//include if your project wasent initialized with composer prior to downloading.
//ensure path to vendor is correct
require_once 'vendor/autoload.php';

use BongaTech\Api\BongaTech;
use BongaTech\Api\Models\Sms;

$instance = new BongaTech("TOKEN_string");

//create multiple Sms Object(s)
$sms1= new Sms("BONGATECH", "0716079675", "Test Message 1", "101");
$sms2 = new Sms("BizTxt", "0716079675", "Test Message 2", "102");

//send Sms object
$response = $instance->sendBatchSMS($sms1, $sms2);

var_dump($response);

Available Methods are:

  1. sendSMS()
  2. sendBatchSMS()
  3. accountBalance()
  4. accountTopUp()

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email makamuevans@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.