PHPackages                             codepower/sms-mitake - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. codepower/sms-mitake

ActiveLibrary[HTTP &amp; Networking](/categories/http)

codepower/sms-mitake
====================

A PHP client for the Mitake (三竹簡訊) SMS HTTP API.

v0.1.0(1mo ago)04.2k↓65.6%MITPHPPHP &gt;=8.1CI passing

Since Jun 1Pushed 1mo agoCompare

[ Source](https://github.com/codepower-tw/sms-mitake-php)[ Packagist](https://packagist.org/packages/codepower/sms-mitake)[ RSS](/packages/codepower-sms-mitake/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

sms-mitake-php
==============

[](#sms-mitake-php)

[![Latest Version](https://camo.githubusercontent.com/845a5bda81f2f098ed6f74494facd6a2fa28bf7401a950a74e2d89561f9db835/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6465706f7765722f736d732d6d6974616b652e737667)](https://packagist.org/packages/codepower/sms-mitake)[![Total Downloads](https://camo.githubusercontent.com/933fe84d4abdfc71d63db4f0a99916be75193a798621bc4d81aaa1d2e2bee6b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6465706f7765722f736d732d6d6974616b652e737667)](https://packagist.org/packages/codepower/sms-mitake)[![License](https://camo.githubusercontent.com/5f3a8dd0674e1a61075f8f65e2d648eb66fb0d3cdddfa5eb222f8ac41ea20920/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f6465706f7765722f736d732d6d6974616b652e737667)](https://packagist.org/packages/codepower/sms-mitake)[![CI](https://github.com/codepower-tw/sms-mitake-php/actions/workflows/ci.yml/badge.svg)](https://github.com/codepower-tw/sms-mitake-php/actions/workflows/ci.yml)[![Security](https://github.com/codepower-tw/sms-mitake-php/actions/workflows/security.yml/badge.svg)](https://github.com/codepower-tw/sms-mitake-php/actions/workflows/security.yml)

A PHP client for the Mitake (三竹簡訊) SMS HTTP API.

Covers single send, bulk send, delivery-status and balance queries, cancellation of scheduled messages, and parsing the delivery-receipt callback.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- ext-curl
- ext-mbstring (only if you send using the Big5 charset)

Installation
------------

[](#installation)

```
composer require codepower/sms-mitake
```

Usage
-----

[](#usage)

```
use CodePower\Mitake\Client;
use CodePower\Mitake\Credentials;
use CodePower\Mitake\Message;

$client = new Client(new Credentials('username', 'password'));
```

By default the client talks to `https://smsapi.mitake.com.tw` using UTF-8. Pass a `Charset` and/or base URL to the constructor to change either, and inject your own `Http\HttpClient` to customise transport or for testing.

### Send one message

[](#send-one-message)

```
$result = $client->send(new Message(to: '0912345678', body: 'Hello 你好'));

$result->msgId;                 // Mitake message serial, e.g. "0000000013"
$result->isAccepted();          // true if accepted
$result->statusCode->code;      // raw status code
$result->accountPoint;          // remaining credit after this send
```

Optional fields — scheduling, validity, a delivery-receipt callback URL, and a de-duplication client id:

```
$client->send(new Message(
    to: '0912345678',
    body: 'See you tomorrow',
    deliverAt: new DateTimeImmutable('2026-06-02 09:00:00'),
    validUntil: new DateTimeImmutable('2026-06-02 12:00:00'),
    callbackUrl: 'https://example.com/mitake/callback',
    clientId: 'order-4821',
));
```

### Send in bulk (up to 500)

[](#send-in-bulk-up-to-500)

Each bulk message **must** carry a `clientId`:

```
$results = $client->sendBulk([
    new Message('0912345678', 'Hi A', clientId: 'a'),
    new Message('0987654321', 'Hi B', clientId: 'b'),
]);
```

### Check length &amp; segments

[](#check-length--segments)

Estimate how a body will be billed and split before sending. GSM extension symbols (`^ { } \ [ ~ ] | €`) count as two characters, and any non-GSM character (Chinese, emoji, …) switches the whole message to the UCS-2 tier:

```
$seg = (new Message('0912345678', 'Hello 你好'))->segmentation();

$seg->encoding;      // SmsEncoding::Ucs2 (a Chinese char forces UCS-2)
$seg->length;        // billed unit count
$seg->segments;      // number of SMS parts
$seg->isMultipart(); // true if more than one part
$seg->remaining;     // free units left in the last part

// Or measure any string directly:
\CodePower\Mitake\Segmentation::measure('plain ascii')->encoding; // SmsEncoding::Gsm7
```

Per-segment sizes are the carrier standard: 160/153 for GSM, 70/67 for UCS-2.

### Query delivery status / balance

[](#query-delivery-status--balance)

```
$statuses = $client->queryStatus(['0000000013', '0000000014']);
foreach ($statuses as $status) {
    $status->statusCode->isDelivered();
    $status->statusTime;   // DateTimeImmutable|null
}

$balance = $client->queryBalance();   // $balance->points
```

### Cancel scheduled messages

[](#cancel-scheduled-messages)

```
foreach ($client->cancel(['0000000013']) as $cancel) {
    $cancel->isCancelled();   // true when status code is 9
}
```

### Handle the delivery-receipt callback

[](#handle-the-delivery-receipt-callback)

Mitake calls your `callbackUrl` with the latest status. Parse the request and reply with the acknowledgement body so Mitake stops retrying:

```
use CodePower\Mitake\Callback\DeliveryReceipt;

$receipt = DeliveryReceipt::fromArray($_GET);

$receipt->msgId;
$receipt->isDelivered();
$receipt->isFinal();

header('Content-Type: text/plain');
echo $receipt->acknowledge();   // "magicid=sms_gateway_rpack\nmsgid=...\n"
```

Security
--------

[](#security)

**Bulk send credentials travel in the URL.** `SmBulkSend` carries its record payload as the request body, so Mitake requires the `username` and `password` in the URL query string (every other call sends them in the POST body). TLS protects them in transit, but query strings are routinely written to access logs and proxies. Make sure any HTTP request logging on your side does not capture full Mitake URLs for `sendBulk` calls. This library never includes the request URL in its exception messages.

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

[MIT](LICENSE) © CodePower Ltd. — applies to this library's own source code.

The Mitake API specification bundled under [`docs/`](docs/) is © Mitake Inc. (三竹資訊股份有限公司), all rights reserved, and is redistributed from Mitake's public [download page](https://sms.mitake.com.tw/common/header/download.jsp) for convenience. It is **not** covered by the MIT license.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance89

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

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

53d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/108053?v=4)[Gasol Wu](/maintainers/gasol)[@Gasol](https://github.com/Gasol)

---

Top Contributors

[![Gasol](https://avatars.githubusercontent.com/u/108053?v=4)](https://github.com/Gasol "Gasol (27 commits)")

---

Tags

mitakephpphp-librarysmssms-apisms-gatewaytaiwansmsTaiwanmitake

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codepower-sms-mitake/health.svg)

```
[![Health](https://phpackages.com/badges/codepower-sms-mitake/health.svg)](https://phpackages.com/packages/codepower-sms-mitake)
```

###  Alternatives

[infobip/infobip-api-php-client

PHP library for consuming Infobip's API

941.9M10](/packages/infobip-infobip-api-php-client)[esendex/sdk

Send SMS from your application using the Esendex API

22989.1k5](/packages/esendex-sdk)[mediaburst/clockworksms

ClockworkSMS, International SMS API

45157.4k4](/packages/mediaburst-clockworksms)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.8k](/packages/ismaeltoe-osms)[greensms/greensms

GREENSMS API: SMS, WhatsApp, Viber, VK, Voice, Call, HLR

2634.3k](/packages/greensms-greensms)[minchao/every8d-php

A EVERY8D SMS SDK for PHP (Unofficial)

1342.8k1](/packages/minchao-every8d-php)

PHPackages © 2026

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