noticero/notice-sdk-php

PHP SDK,封装了 notice.ro API

v1 2024-04-20 20:06 UTC

This package is auto-updated.

Last update: 2024-09-20 21:17:09 UTC


README

在查看之前检查文档

API 文档

安装

composer require noticero/notice-sdk-php

使用

use Notice\SdkPhp\SdkPhp;

require_once 'vendor/autoload.php';

$notice = new SdkPhp('YOUR-API-TOKEN');

发送短信

仅使用电话号码和消息

$notice->sendSms([
    'number' => '07XXXXXXXX',
    'message' => 'Hello, world!'
]);

使用模板 ID 和变量

$notice->sendSms([
    'number'  =>  '07XXXXXXXX',
    'template_id'  =>  1,
    'variables'  => [
	    'order_id'  =>  '123',
	    'total'  =>  '100',
	]
]);

在此处查看可用于模板的可用变量

获取接收到的短信列表

$notice->getIncomeSmsList();

获取已发送短信列表

$notice->getSentSmsList();

获取模板列表

$notice->getTemplates();