PHP Cloud Rebue 批量短信 API SDK

v1.0.3 2023-01-02 16:37 UTC

This package is auto-updated.

Last update: 2024-09-30 01:34:49 UTC


README

Latest Version on Packagist Software License Total Downloads

此 PHP SDK 提供了方便的方法来消费 CloudRebue API。

文档

CloudRebue API 文档可以在 https://developers.cloudrebue.co.ke 找到

安装

通过 Composer(推荐)

$ composer require cloudrebue/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 CloudRebue\Api\CloudRebue;
use CloudRebue\Api\Models\Sms;

$instance = new CloudRebue("TOKEN_string");

//create an Sms Object
$sms= new Sms("CLOUD_REBUE", "0708361797", "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 CloudRebue\Api\CloudRebue;
use CloudRebue\Api\Models\Sms;

$instance = new CloudRebue("TOKEN_string");

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

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

var_dump($response);

可用方法有

  1. sendSMS()
  2. sendBatchSMS()
  3. sendVoiceSMS()
  4. sendBatchVoiceSMS()
  5. accountBalance()
  6. accountTopUp()

变更日志

请参阅 CHANGELOG 了解最近有哪些更改。

测试

$ composer test

贡献

请参阅 CONTRIBUTINGCODE_OF_CONDUCT 了解详细信息。

安全

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

致谢

许可

MIT 许可证(MIT)。请参阅 许可文件 了解更多信息。