PHP Bongatech API

0.7.2 2023-09-25 21:16 UTC

This package is auto-updated.

Last update: 2024-09-25 23:40:53 UTC


README

Latest Version on Packagist Software License Total Downloads

此 PHP SDK 为使用 BongaTech API 提供方便的方法。

文档

BongaTech API 文档可在 https://bulk.bongatech.co.ke/docs 找到

安装

通过 Composer(推荐)

$ composer require bongatech/api

通过下载

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

用法

发送消息

详细示例可以在 示例文件夹 中获得

<?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);

批量发送消息

<?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);

可用方法有

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

变更日志

有关最近更改的更多信息,请参阅 CHANGELOG

测试

$ composer test

贡献

请参阅 CONTRIBUTINGCODE_OF_CONDUCT 以获取详细信息。

安全

如果您发现任何安全相关的问题,请通过电子邮件 makamuevans@gmail.com 联系,而不是使用问题跟踪器。

鸣谢

许可证

MIT 许可证(MIT)。有关更多信息,请参阅 许可证文件