irteel/irteelsms

irteele SMS API是为irteel SMS构建的 - 市场营销的批量短信应用程序

2.0.0 2021-07-24 16:54 UTC

This package is not auto-updated.

Last update: 2024-09-21 21:53:10 UTC


README

Latest Stable Version License GitHub issues GitHub stars

IRTEEL SMS API

IRTEEL SMS API是为IRTEEL SMS构建的 - 市场营销的批量短信应用程序

先决条件

要运行IRTEEL SMS API,您需要在您的服务器上安装IRTEEL SMS应用程序。有关更多详细信息,请访问:IRTEEL SMS

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

安装

通过Composer

composer require irteel/irteelsms 

和通过Bash

git clone https://github.com/irteel/irteelsms.git

使用方法

步骤1

如果您使用Git Clone安装IRTEEL SMS API,则加载您的IRTEEL SMS API类文件并使用命名空间。

require_once 'src/Api/IRTEELSMSAPI.php';
use IRTEELSMS\IRTEELSMSAPI;

如果您使用Composer安装IRTEEL SMS API,请在您的项目的index.php文件中require/包含autoload.php文件或您需要的任何文件,以便使用IRTEEL SMS API类:

require 'vendor/autoload.php';
use IRTEELSMS\IRTEELSMSAPI;

步骤2:从https://my.irteelsms.com/developers设置您的API_KEY

$token = '3|39VVNH7w6pTaNEUgnTzpcX1iDsmnulcqFyMBv3TR';

步骤3

更改下面的sender_id数字。它可以是有效的电话号码或字符串

$sender_id = 'irteelSMS';

步骤4

我们发送给接收者的电话号码 - 任何电话号码

$recipient = '237695601314';

对于多个号码,请在每个单独的号码后使用逗号(,)。

$recipient = '237695601314,8801721000000,880167000000,01913000000';

您可以在单个API请求中使用逗号插入最多100个号码。

您必须包括国家代码在电话号码的开头。

步骤5

将URL设置为https://my.irteelsms.com/api/v3 <api/v3>是您安装URL上的强制要求

$url = 'https://my.irteelsms.com/api/v3';

// 短信正文

$message = 'test message sender_id IRTEEL SMS V3';
The sms type (Plain,Voice,MMS,Wathsapp)
// Plain text SMS
$type = 'plain'; //For Plain text message

// 安排短信

$schedule_time='2021-12-20 07:00'; //Time like this format: y-m/d h:mm

// 为请求创建纯文本短信正文

$message_body = array(

    'recipient' => $recipient,
    'sender_id' => $sender_id,
    'message' => $message,
	    'type' => 'plain',
);

// 为请求创建语音短信正文

$message_body = array(

    'recipient' => $recipient,
    'sender_id' => $sender_id,
    'message' => $message,
    'type' => 'voice',
);

// 为请求创建彩信短信正文

$message_body = array(

    'recipient' => $recipient,
    'sender_id' => $sender_id,
    'message' => $message, //optional
    'type' => 'mms',
    'media_url'='https://via.placeholder.com/150.jpg'
);

// 为请求创建WhatsApp短信正文

$message_body = array(

    'recipient' => $recipient,
    'sender_id' => $sender_id,
    'message' => $message,
    'type' => 'Whathsapp',
);

// 为请求创建安排短信正文

$message_body = array(
    'recipient' => $recipient,
    'sender_id' => $sender_id,
    'message' => $message,
	'type' => $type,
    'schedule_time' => $schedule_time
);

步骤6

实例化一个新的IRTEEL SMS对象发送短信请求

$client = new IRTEELSMS($url,$message_body,$token);

发送短信

最后通过IRTEEL SMS API发送您的消息

$response = $client->sms_send();

步骤6

实例化一个新的IRTEEL SMS对象获取报告请求

$client = new IRTEELSMS($url,'',$token);

获取投递报告

获取您所有的消息

$view_all_message=$client->sms_views();

获取余额

获取您的账户余额

$get_balance=$client->sms_balance();

响应

IRTEEL SMS API以json格式返回响应,如下所示

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

状态码

作者

  • ing: Cyrille Brice Bidongo Bekono - 初始工作 - irteel