PHPackages                             rootscratch/sms - 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. rootscratch/sms

ActiveLibrary[API Development](/categories/api)

rootscratch/sms
===============

Android SMS Gateway transforms your Android smartphone into an SMS gateway. It is a lightweight application that enables you to send SMS messages programmatically via an API, making it ideal for integrating SMS functionality into your applications or services.

2.0.3(1y ago)516PHP

Since Feb 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jaycee0610/RootScratch-SMS-API)[ Packagist](https://packagist.org/packages/rootscratch/sms)[ RSS](/packages/rootscratch-sms/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (5)Used By (0)

[![Logo](https://repository-images.githubusercontent.com/793146864/6fb1ef96-255c-4946-bd88-3b26e7c17e3d)](https://repository-images.githubusercontent.com/793146864/6fb1ef96-255c-4946-bd88-3b26e7c17e3d)

📱 Android SMS Gateway (PHP)
===========================

[](#-android-sms-gateway-php)

Android SMS Gateway transforms your Android smartphone into an SMS gateway. It is a lightweight application that enables you to send SMS messages programmatically via an API, making it ideal for integrating SMS functionality into your applications or services.

-
-

🚀 Installation
--------------

[](#-installation)

To install the `rootscratch/sms` via Composer, run the following command:

```
composer require rootscratch/sms
```

📖 Usage/Examples
----------------

[](#-usageexamples)

To use the Rootscratch SMS in your PHP project, include the Composer autoloader:

```
require_once __DIR__ . '/vendor/autoload.php';

use Rootscratch\SMS\Configuration;
$configuration = new Configuration();

// Set API Key
$configuration->setApiKey('your_api_key');
```

⚙️ Configuration Usage
----------------------

[](#️-configuration-usage)

```
/**
 * Configuration
 *
 * Get Devices = getDevices()
 * Get Balance = getBalance()
 *
 * Get Message By ID = getMessageByID($id) : if $id int = message id, if $id string = group id
 *
 * Get Message By Status = getMessagesByStatus($status, $deviceID = null, $simID = null, $time = null, $endTimestamp = null)
 * Get messages "received" on SIM 1 of device ID 8 in last 24 hours = getMessagesByStatus("Received", 8, 0, time() - 86400)
 *
 * Get USSD Request By ID = getUssdRequestByID($id)
 * Get USSD requests with request text "*150#" sent in last 24 hours. = getUssdRequests("*150#", null, null, time() - 86400)
 *
 * Add a new contact to contacts list 1 or resubscribe the contact if it already exists. = addContact(1, "+11234567890", "Test", true);
 * Unsubscribe a contact using the mobile number. = unsubscribeContact(1, "+11234567890");
 *
 */
echo json_encode($configuration->getDevices(), JSON_PRETTY_PRINT);
```

📤 Send Single SMS
-----------------

[](#-send-single-sms)

```
use Rootscratch\SMS\Send;
$sendMessage = new Send();

$send_single = $sendMessage->sendSingleMessage('mobile_number', 'Message');

echo json_encode($send_single, JSON_PRETTY_PRINT);
```

📥 Send Bulk Message
-------------------

[](#-send-bulk-message)

```
$send_bulk = $sendMessage->sendMessages([
    [
        "number" => "6391234567890",
        "message" => "Message 1"
    ],
    [
        "number" => "6391234567891",
        "message" => "Message 2"
    ]
]);
echo json_encode($send_bulk, JSON_PRETTY_PRINT);
```

🖼️ Send MMS Sample
------------------

[](#️-send-mms-sample)

- Use All Sims = sendMessages(messages = array, option = USE\_ALL\_SIMS)
- Use All Devices = sendMessages(messages = array, option = USE\_ALL\_DEVICES)
- Use Specified Devices = sendMessages(messages = array, option = USE\_SPECIFIED, devices = array)

```
/**
 * Send MMS Sample
 * Use All Sims = sendMessages(messages = array, option = USE_ALL_SIMS)
 * Use All Devices = sendMessages(messages = array, option = USE_ALL_DEVICES)
 * Use Specified Devices = sendMessages(messages = array, option = USE_SPECIFIED, devices = array)
 */

$send_bulk_mms = $sendMessage->sendMessages([
    [
        "number" => "639123456789",
        "message" => "Test 1",
        "type" => "mms",
        "attachments" => 'https://sample.com/1.png'
    ],
    [
        "number" => "639123456789",
        "message" => "Test 2",
        "type" => "mms",
        "attachments" => 'https://sample.com/1.png'
    ]
]);
echo json_encode($send_bulk_mms, JSON_PRETTY_PRINT);
```

📇 Send Message To Contacts List
-------------------------------

[](#-send-message-to-contacts-list)

Send a message on **schedule** to contacts in contacts list with ID of 1.

```
$sendMessage->sendMessageToContactsList(1, "Test", null, null, strtotime("+2 minutes"));
```

Send a message to contacts in contacts list with ID of 1.

```
$send_contact_list = $sendMessage->sendMessageToContactsList(
    1,
    'Via Contact List!',
    Configuration::USE_SPECIFIED,
    [4]
);
echo json_encode($send_contact_list, JSON_PRETTY_PRINT);
```

📲 Send USSD Request
-------------------

[](#-send-ussd-request)

Send a USSD request using the default SIM of Device ID 1.

```
$send_ussd = $sendMessage->sendUssdRequest('*150#', 1);
echo json_encode($send_ussd, JSON_PRETTY_PRINT);
```

Send a USSD request using SIM in **slot 1** of Device ID 1.

```
$send_ussd = $sendMessage->sendUssdRequest('*150#', 1, 0);
echo json_encode($send_ussd, JSON_PRETTY_PRINT);
```

Send a USSD request using SIM in **slot 2** of Device ID 1.

```
$send_ussd = $sendMessage->sendUssdRequest('*150#', 1, 1);
echo json_encode($send_ussd, JSON_PRETTY_PRINT);
```

🔄 Resend SMS
------------

[](#-resend-sms)

```
/**
 * Resend SMS Sample
 * Resend Message By ID = resendMessageByID(id = int)
 * Resend Messages By Group ID = resendMessagesByGroupID(group_id = string, status = string)
 */

use Rootscratch\SMS\Resend;

$resend = new Resend();

$resend_by_id = $resend->resendMessagesByGroupID('MZ7QabWteHWfSkjkgX67acc67bcc2048.73874662', 'Failed');
echo json_encode($resend_by_id, JSON_PRETTY_PRINT);
```

🛠️ Support
----------

[](#️-support)

For support, please email me at .

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance43

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

Every ~4 days

Total

4

Last Release

448d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/96e7723302f2828740841377232dddee236a773b0873fbe7a3a90aed929e6de5?d=identicon)[jaycee0610](/maintainers/jaycee0610)

---

Top Contributors

[![jaycee0610](https://avatars.githubusercontent.com/u/120337618?v=4)](https://github.com/jaycee0610 "jaycee0610 (29 commits)")

---

Tags

phprootscratchsmssms-apisms-gateway

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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