mtechke/api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mtechke/api

Composer 安装命令:

composer require mtechke/api

包简介

Mtech sms api package

README 文档

README

Latest Stable Version

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 mtechke/api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-21