PHPackages                             expertsystemsau/transmitsms-php-client - 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. expertsystemsau/transmitsms-php-client

ActiveLibrary[API Development](/categories/api)

expertsystemsau/transmitsms-php-client
======================================

Framework-agnostic PHP client for the TransmitSMS API

v1.9.0(1mo ago)0411MITPHPPHP ^8.2

Since Dec 9Pushed 6mo agoCompare

[ Source](https://github.com/expertsystemsau/transmitsms-php-client)[ Packagist](https://packagist.org/packages/expertsystemsau/transmitsms-php-client)[ Docs](https://github.com/expertsystemsau/transmitsms-php-client)[ RSS](/packages/expertsystemsau-transmitsms-php-client/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (8)Versions (7)Used By (1)

TransmitSMS PHP Client
======================

[](#transmitsms-php-client)

[![Latest Version on Packagist](https://camo.githubusercontent.com/59c3b4f5eb09beb1288a4ae280491885bc53ec345bc01a705083307785aae6c3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65787065727473797374656d7361752f7472616e736d6974736d732d7068702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/expertsystemsau/transmitsms-php-client)[![Total Downloads](https://camo.githubusercontent.com/f455da1513d5436e15f1f0ee8b3825878f170223027bb471bce5a298a1c62b44/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65787065727473797374656d7361752f7472616e736d6974736d732d7068702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/expertsystemsau/transmitsms-php-client)[![License](https://camo.githubusercontent.com/37beba0213f2a66ca39dc43387ec3b443cf046f182e6f49f6671c1c28fd8eea3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f65787065727473797374656d7361752f7472616e736d6974736d732d7068702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/expertsystemsau/transmitsms-php-client)

A framework-agnostic PHP client for the [TransmitSMS API](https://transmitsms.com/).

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

[](#installation)

```
composer require expertsystemsau/transmitsms-php-client
```

Usage
-----

[](#usage)

```
use ExpertSystems\TransmitSms\TransmitSmsClient;

$client = new TransmitSmsClient('your-api-key', 'your-api-secret');

// Send an SMS
$response = $client->sendSms('+61400000000', 'Hello from TransmitSMS!');

// Send to multiple recipients
$response = $client->sendSms(['+61400000000', '+61400000001'], 'Bulk message');

// Send with options
$response = $client->sendSms('+61400000000', 'Scheduled message', [
    'from' => 'MySenderID',
    'send_at' => '2024-12-25 09:00:00',
]);

// Check message status
$status = $client->getMessageStatus('message-id');

// Get account balance
$balance = $client->getBalance();

// Get SMS replies
$replies = $client->getSmsReplies();

// Get delivery reports
$reports = $client->getDeliveryReports();

// Manage contacts
$lists = $client->getLists();
$client->addContact(123, '+61400000000', ['first_name' => 'John']);
```

DLR &amp; Reply Callbacks
-------------------------

[](#dlr--reply-callbacks)

The client provides utilities for handling DLR (Delivery Receipt) and Reply callbacks with signed URLs.

### Setting Up Callback URLs

[](#setting-up-callback-urls)

```
use ExpertSystems\TransmitSms\TransmitSmsConnector;
use ExpertSystems\TransmitSms\TransmitSmsClient;
use ExpertSystems\TransmitSms\Requests\SendSmsRequest;
use ExpertSystems\TransmitSms\Callbacks\CallbackUrlBuilder;
use ExpertSystems\TransmitSms\Callbacks\CallbackType;

// Create connector and client
$connector = new TransmitSmsConnector(
    apiKey: 'your-api-key',
    apiSecret: 'your-api-secret'
);
$client = new TransmitSmsClient($connector);

// Create URL builder with your webhook base URL and signing key
$urlBuilder = new CallbackUrlBuilder(
    baseUrl: 'https://myapp.com/webhooks/sms',
    signingKey: 'your-secret-signing-key'
);

// Send SMS with callbacks
$request = (new SendSmsRequest('Your order has shipped!'))
    ->to('61400000000')
    ->from('MYSTORE')
    ->dlrCallback(
        $urlBuilder->build(
            type: CallbackType::DLR,
            handler: 'App\\Webhooks\\OrderDlrHandler',
            context: ['order_id' => 123]
        )
    )
    ->replyCallback(
        $urlBuilder->build(
            type: CallbackType::REPLY,
            handler: 'App\\Webhooks\\OrderReplyHandler',
            context: ['order_id' => 123]
        )
    );

$result = $client->sms()->sendRequest($request);
```

### Handling Incoming Callbacks

[](#handling-incoming-callbacks)

In your webhook endpoint, parse and verify the callback:

```
use ExpertSystems\TransmitSms\Callbacks\CallbackUrlParser;
use ExpertSystems\TransmitSms\Data\DlrCallbackData;
use ExpertSystems\TransmitSms\Data\ReplyCallbackData;
use ExpertSystems\TransmitSms\Exceptions\InvalidSignatureException;

$parser = new CallbackUrlParser('your-secret-signing-key');

try {
    // Parse and verify signature
    $parsed = $parser->parse($_GET);

    // Create DTO from callback data
    $dlr = DlrCallbackData::fromRequest($_GET);

    // Access handler and context
    $handlerClass = $parsed['handler'];  // 'App\Webhooks\OrderDlrHandler'
    $context = $parsed['context'];        // ['order_id' => 123]

    // Call your handler
    $handler = new $handlerClass();
    $handler->handle($dlr, $context);

    http_response_code(200);
    echo 'OK';

} catch (InvalidSignatureException $e) {
    http_response_code(403);
    echo 'Invalid signature';
}
```

### Callback Data DTOs

[](#callback-data-dtos)

**DlrCallbackData** - Delivery receipt information:

```
$dlr = DlrCallbackData::fromRequest($data);

$dlr->messageId;        // int - The message ID
$dlr->mobile;           // string - Recipient phone number
$dlr->status;           // string - 'delivered', 'failed', 'pending'
$dlr->datetime;         // ?string - Delivery timestamp
$dlr->errorCode;        // ?string - Error code if failed
$dlr->errorDescription; // ?string - Error description if failed

$dlr->isDelivered();    // bool - Check if delivered
$dlr->isFailed();       // bool - Check if failed
$dlr->isPending();      // bool - Check if pending
```

**ReplyCallbackData** - Reply message information:

```
$reply = ReplyCallbackData::fromRequest($data);

$reply->messageId;      // int - Original message ID
$reply->mobile;         // string - Sender phone number
$reply->message;        // string - Reply message text
$reply->receivedAt;     // string - Timestamp when received
$reply->responseId;     // ?int - Reply ID
$reply->longcode;       // ?string - Number replied to
```

**LinkHitCallbackData** - Link click information:

```
$linkHit = LinkHitCallbackData::fromRequest($data);

$linkHit->messageId;    // int - Message ID
$linkHit->mobile;       // string - Recipient phone number
$linkHit->url;          // string - URL that was clicked
$linkHit->clickedAt;    // string - Click timestamp
$linkHit->userAgent;    // ?string - Browser user agent
$linkHit->ipAddress;    // ?string - IP address
```

Laravel Integration
-------------------

[](#laravel-integration)

For Laravel projects, use [expertsystemsau/transmitsms-laravel](https://packagist.org/packages/expertsystemsau/transmitsms-laravel) which provides:

- Service provider with automatic configuration
- Facade for convenient access
- Notification channel integration
- **Automatic webhook handling** with job dispatching
- Event-driven callback processing

License
-------

[](#license)

The MIT License (MIT). Please see [License File](../../LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance77

Regular maintenance activity

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.8% 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 ~41 days

Recently: every ~51 days

Total

6

Last Release

37d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44283103?v=4)[xsys](/maintainers/xsys)[@Xsys](https://github.com/Xsys)

---

Top Contributors

[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (26 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (4 commits)")[![mitchello77](https://avatars.githubusercontent.com/u/9065203?v=4)](https://github.com/mitchello77 "mitchello77 (3 commits)")

---

Tags

smsapi clienttransmitsmsExpertSystems

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/expertsystemsau-transmitsms-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/expertsystemsau-transmitsms-php-client/health.svg)](https://phpackages.com/packages/expertsystemsau-transmitsms-php-client)
```

###  Alternatives

[smsapi/php-client

SMSAPI API PHP Client

662.3M19](/packages/smsapi-php-client)[smsapi.pl/php-client

SMSAPI API PHP Client

6682.5k1](/packages/smsapipl-php-client)[sandorian/moneybird-api-php

Moneybird API client for PHP

148.6k](/packages/sandorian-moneybird-api-php)[myoutdeskllc/salesforce-php

salesforce library for php8+

1586.3k](/packages/myoutdeskllc-salesforce-php)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1125.1k](/packages/codebar-ag-laravel-docuware)

PHPackages © 2026

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