PHPackages                             mtechke/api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mtechke/api

ActiveLibrary[API Development](/categories/api)

mtechke/api
===========

Mtech sms api package

0.0.1(2y ago)06MITPHPPHP &gt;=7.1

Since Jun 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mtechsolution/mtechapi)[ Packagist](https://packagist.org/packages/mtechke/api)[ RSS](/packages/mtechke-api/feed)WikiDiscussions release Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Mtech Php SDK
=============

[](#mtech-php-sdk)

[![Latest Stable Version](https://camo.githubusercontent.com/a61069d9f81d3c76535e7f97a43be5852bfa66ba1cf1608e49136dad34fbff73/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d746563686b652f617069)](https://packagist.org/packages/mtechke/api)

> This SDK provides a seamless integration to MTECH products

Install
-------

[](#install)

You can install the PHP SDK via composer or by downloading the source

#### Via Composer

[](#via-composer)

The recommended way to install the SDK is with [Composer](http://getcomposer.org/).

```
composer require mtechke/api
```

Usage
-----

[](#usage)

The SDK needs to be instantiated using your username and API key, which you can get from the [MTECH service portal](https://mtechcomm.co.ke/).

### Token Generation

[](#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

[](#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

[](#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&amp;status=DeliveredToTerminal&amp;msisdn=254712723648](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
------

[](#issues)

*If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/mtechsolution/mtechapi/issues).*

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1062d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4e8d6b056e7bd81d18961860488a2e53a303b3d2512b3e31134db384bcd9fd9?d=identicon)[mtechke](/maintainers/mtechke)

---

Top Contributors

[![KabataMacharia](https://avatars.githubusercontent.com/u/25218383?v=4)](https://github.com/KabataMacharia "KabataMacharia (8 commits)")

---

Tags

apismstext messagemtech

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mtechke-api/health.svg)

```
[![Health](https://phpackages.com/badges/mtechke-api/health.svg)](https://phpackages.com/packages/mtechke-api)
```

###  Alternatives

[africastalking/africastalking

Official Africa's Talking PHP SDK

122557.6k10](/packages/africastalking-africastalking)[plivo/plivo-php

A PHP SDK to make voice calls &amp; send SMS using Plivo and to generate Plivo XML

1102.8M18](/packages/plivo-plivo-php)[plivo/php-sdk

A PHP SDK to make voice calls &amp; send SMS using Plivo and to generate Plivo XML

1101.9M5](/packages/plivo-php-sdk)[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)[smsfactor/smsfactor-php-sdk

SMSFactor client library for PHP

15382.5k2](/packages/smsfactor-smsfactor-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
