instasent / instasent-php-lib
Instasent API 的 PHP 封装库
0.1.4
2020-07-24 09:07 UTC
Requires
- php: >=5.2.1
This package is not auto-updated.
Last update: 2024-09-14 07:30:07 UTC
README
欢迎使用 Instasent PHP SDK。本仓库包含 Instasent REST API 的 PHP SDK。
注意!
验证 产品目前已被弃用,将在下一个版本中删除。相同的功能可以通过发送短信轻松实现。如需迁移帮助,请与我们联系
安装
安装 SDK 最简单的方法是使用 composer
composer require instasent/instasent-php-lib
或手动下载源代码
下载库后,将 instasent-php-lib 文件夹移动到您的项目目录,然后包含库文件
require_once(__DIR__ . '/path/to/lib/Abstracts/InstasentClient.php');
require_once(__DIR__ . '/path/to/lib/SmsClient.php');
用法
查看 示例目录,了解 SDK 的使用示例
发送短信
$instasentClient = new Instasent\SmsClient('my-token'); $response = $instasentClient->sendSms('Company', '+34666666666', 'test message'); echo $response['response_code']; echo $response['response_body'];
如果您想发送 Unicode 短信(例如包含 😀 表情的短信),只需将 sendSms
调用替换为 sendUnicodeSms
$response = $instasentClient->sendUnicodeSms('Company', '+34666666666', 'Unicode test: ña éáíóú 😀');
可用操作
SMS
SmsClient::sendSms(sender, to, text)
SmsClient::sendUnicodeSms(sender, to, text)
SmsClient::getSms(page, per_page)
SmsClient::getSmsById(message_id)
LOOKUP
LookupClient::doLookup(to)
LookupClient::getLookups(page, per_page)
LookupClient::getLookupById(id)
ACCOUNT
instasent::getAccountBalance()
完整文档
API 的完整文档可以在 http://docs.instasent.com/ 找到
获取帮助
如果您需要安装或使用 SDK 的帮助,请通过 support@instasent.com 联系 Instasent 支持
如果您在库中发现了错误或有功能请求,请继续提交问题或拉取请求!