mtechke/api
Composer 安装命令:
composer require mtechke/api
包简介
Mtech sms api package
关键字:
README 文档
README
This SDK provides a seamless integration to MTECH products
Install
You can install the PHP SDK via composer or by downloading the source
Via Composer
The recommended way to install the SDK is with Composer.
composer require mtechke/api
Usage
The SDK needs to be instantiated using your username and API key, which you can get from the MTECH service portal.
Token Generation
use Mtechke\Api\MtechApi;; $username = 'YOUR_USERNAME'; $apiKey = 'YOUR_API_KEY'; $mtechApi = new MtechApi($username, $apiKey); $token = $mtechApi->token(); $result = $token->getToken(); print_r($result);
Send SMS
use Mtechke\Api\MtechApi;; $username = 'YOUR_USERNAME'; $apiKey = 'YOUR_API_KEY'; $mtechApi = new MtechApi($username, $apiKey); $token = $mtechApi->sms(); $result = $token->sendSms([ "msisdns" => ["254XXXXXXXXX","254XXXXXXXXX"], 'sender' => "sender id", 'message_id' => uniqid(), 'message' => "Message", 'token' => "XXXX", // token generated on the token generation "message_type" => "Promotional", "dlr_url" => "https://callbackexample.com" ]); print_r($result);
SMS
-
message_id: This is the unique alphanumeric that is used to identify each client message. This is the id that will be used to send the delivery status of client messages via the "dlr_url" provided. -
message: This is the message string that is to be delivered to the handset user. NB: There is no upper limit for the message string length. Do note that a message is 160 characters. If you send a message with 161 characters, we will charge as 2 messages. -
sender: This the SenderName to be used to deliver the message. If you not sure what to provide, kindly contact Mtech support for counsel. -
message_type: This can be either be "Transactional" or "Promotional". "Transactional" takes higher priority than "Promotional" messages. "Transactional" messages include OTPs. -
dlr_url: This is the GET callback url Mtech will use to forward the delivery status of each message to client system. Sample request: https://callbackexample.com?message_id=aa747fhvhh-47748-464&status=DeliveredToTerminal&msisdn=254712723648 NB: Mtech will forward the message delivery report for each sent message immediately after we receive it from the network. -
encrypted: Provide "1" if the string provided in the "message" parameter is encrypted. Else, provide "0" if the message is in plaintext. -
encryption_method: This is the encryption method used to encrypt the string provided in the message parameter E.g id-aes256-GCM -
msisdns: This parameter takes an array containing the list of phone numbers to receive the message. E.g ["254726789778","254726789778"]
NB: We advice that you send the messages in batches (1-500 msisdns in each request ) to reduce the size of the payload
NB: Use international country prefixes when providing the msisdns e.g 254712723648
Issues
If you find a bug, please file an issue on our issue tracker on GitHub.
mtechke/api 适用场景与选型建议
mtechke/api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 06 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「sms」 「text message」 「mtech」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mtechke/api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mtechke/api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mtechke/api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
A PSR-7 compatible library for making CRUD API endpoints
Common libraries used by Zimbra Api
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Extensible library for building notifications and sending them via different delivery channels.
Text file manipulation
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-21