PHPackages                             fastsms/sdk - 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. fastsms/sdk

ActiveSdk[API Development](/categories/api)

fastsms/sdk
===========

SDK for FastSMS api.

v1.2.0(8y ago)542.1k↓36.4%3BSD-3-ClausePHPPHP &gt;=5.4.0

Since May 27Pushed 7y ago8 watchersCompare

[ Source](https://github.com/fastsmsuk/php-sdk)[ Packagist](https://packagist.org/packages/fastsms/sdk)[ RSS](/packages/fastsms-sdk/feed)WikiDiscussions master Synced 1mo ago

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

PHP SDK for FastSMS API.
========================

[](#php-sdk-for-fastsms-api)

PHP library to access [FastSMS](http://www.fastsms.co.uk/) api. Thank you for choosing [FastSMS](http://www.fastsms.co.uk/)
[![Latest Stable Version](https://camo.githubusercontent.com/c6ac60d0faffbdb0e807730d0039b471465aee73b674a9d3984077aa056ba416/68747470733a2f2f706f7365722e707567782e6f72672f66617374736d732f73646b2f762f737461626c65)](https://packagist.org/packages/fastsms/sdk)[![Total Downloads](https://camo.githubusercontent.com/935e370066265849e98297f6a763817f29ab7439669f0e186a2081839f26049a/68747470733a2f2f706f7365722e707567782e6f72672f66617374736d732f73646b2f646f776e6c6f616473)](https://packagist.org/packages/fastsms/sdk)[![Latest Unstable Version](https://camo.githubusercontent.com/220144852a2fe6f39f36985429b95e3cab99e93c889039875d2455b7b575417c/68747470733a2f2f706f7365722e707567782e6f72672f66617374736d732f73646b2f762f756e737461626c65)](https://packagist.org/packages/fastsms/sdk)[![License](https://camo.githubusercontent.com/ba91968ff853a9865355e6f67f42426da51e269876a65801aae486e132a95610/68747470733a2f2f706f7365722e707567782e6f72672f66617374736d732f73646b2f6c6963656e7365)](https://packagist.org/packages/fastsms/sdk)[![Build Status](https://camo.githubusercontent.com/96429a7688318687cd1138a936c3f95a687c627209fd4274cbdea03ab361de64/68747470733a2f2f7472617669732d63692e6f72672f66617374736d73756b2f7068702d73646b2e737667)](https://travis-ci.org/fastsmsuk/php-sdk)DIRECTORY STRUCTURE
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#php-library-to-access-fastsms-apithank-you-for-choosing-fastsmsdirectory-structure)

```
src/                 core wrapper code
tests/               tests of the core wrapper code

```

REQUIREMENTS
------------

[](#requirements)

The minimum requirement by FastSMS wrapper is that your Web server supports PHP 5.4.

DOCUMENTATION
-------------

[](#documentation)

FastSMS has a [Knowledge Base](http://support.fastsms.co.uk/knowledgebase/) and a [Developer Zone](http://support.fastsms.co.uk/knowledgebase/category/developer-zone/) which cover every detail of FastSMS API.

INSTALLATION
------------

[](#installation)

Add to composer

```
"require": {
    ...
    "fastsms/sdk": "*",
    ...
}
```

USAGE
=====

[](#usage)

Init SDK
--------

[](#init-sdk)

Your token (found in your [settings](https://my.fastsms.co.uk/account/settings) within NetMessenger)

```
$FastSMS = new FastSMS\Client('your token');

```

or

```
use FastSMS\Client;
...
$FastSMS = new Client('your token');
...

```

Wrap errors
-----------

[](#wrap-errors)

List all API codes found in [docs](http://support.fastsms.co.uk/knowledgebase/http-documentation/#ErrorCodes)

```
use FastSMS\Client;
use FastSMS\Exception\ApiException;
...
$client = new Client('your token');
try {
    $credits = $client->credits->getBalance();
} catch (ApiException $aex) {
    echo 'API error #' . $aex->getCode() . ': ' . $aex->getMessage();
} catch (Exception $ex) {
    echo $ex->getMessage();
}

```

Actions
-------

[](#actions)

### Credits

[](#credits)

Checks your current credit balance.

```
$credits = $client->credits->balance; //return float val
echo number_format($credits, 2); //example show 1,000.00

```

### Send

[](#send)

Sends a message. More information read [this](http://support.fastsms.co.uk/knowledgebase/http-documentation/#SendMessage)

```
...
use FastSMS\Model\Message;
...
// Init Message data
$data = [
    //set
    'destinationAddress' => 'Phone number or multiple numbers in array',
    //or
    'list' => 'Your contacts list',
    //or
    'group' => 'Your contacts group'

    'sourceAddress' => 'Your Source Address',
    'body' => 'Message Body', //Note: max 459 characters
    //optionals
    'scheduleDate' => time() + 7200, //now + 2h
    'validityPeriod' => 3600 * 6, //maximum 86400 = 24 hours
    'sourceTON' => 1, //The Type Of Number for the source address (1 for international, 5 for alphanumeric)
];
$result = $client->message->send($data);

```

### Check message status

[](#check-message-status)

Check send message status. More information read [this](http://support.fastsms.co.uk/knowledgebase/http-documentation/#CheckMessageStatus)

```
$result = $client->message->status($messageId);// Message Id must be integer

```

### Create User

[](#create-user)

Create new child user. Only possible if you are an admin user. More information read [this](http://support.fastsms.co.uk/knowledgebase/http-documentation/#CreateUser)

```
...
use FastSMS\Model\User;
// Init user data
$data = [
    'childUsername' => 'Username',
    'childPassword' => 'Password',
    'accessLevel' => 'Normal', //or 'Admin'
    'firstName' => 'John',
    'lastName' => 'Doe',
    'email' => 'user@example.com',
    'credits' => 100,
    //optionals
    'telephone' => 15417543010, // integer
    'creditReminder' => 10,
    'alert' => 5, //5 days
];
$result = $client->user->create($data);

```

### Update Credits

[](#update-credits)

Transfer credits to/from a child user. Only possible if you are an admin user. More information read [this](http://support.fastsms.co.uk/knowledgebase/http-documentation/#UpdateCredits)

```
...
use FastSMS\Model\User;
// Init update user data
$data = [
    'childUsername' => 'Exist Username',
    'quantity' => -5, //The amount of credits to transfer.
];
$user = new User($data);
$result = $client->user->update($user);

```

### Reports

[](#reports)

Retrieve the data from a report. More information read [this](http://support.fastsms.co.uk/knowledgebase/http-documentation/#Reports)Aviable types:

- ArchivedMessages
- ArchivedMessagesWithBodies
- ArchivedMessagingSummary
- BackgroundSends
- InboundMessages
- KeywordMessageList
- Messages
- MessagesWithBodies
- SendsByDistributionList
- Usage

```
...
use FastSMS\Model\Report;
...
// Init Report params
$data = [
    'reportType' => 'Messages',
    'from' => time() - 3600 * 24 * 30,
    'to' => time()
];
// Get report
$result = $client->report->get($data);

```

### Add contact(s)

[](#add-contacts)

Create contact(s). More information read [this](http://support.fastsms.co.uk/knowledgebase/http-documentation/#ImportContactsCSV)

```
...
use FastSMS\Model\Contact;
...
// Init Contacts data
$data = [
    'contacts' => [
        ['name' => 'John Doe 1', 'number' => 15417543011, 'email' => 'john.doe.1@example.com'],
        ['name' => 'John Doe 2', 'number' => 15417543012, 'email' => 'john.doe.2@example.com'],
        ['name' => 'John Doe 3', 'number' => 15417543013, 'email' => 'john.doe.3@example.com'],
    ],
    'ignoreDupes' => false,
    'overwriteDupes' => true
];
// Get report
$result = $client->contact->create($data);

```

### Delete All Contacts

[](#delete-all-contacts)

More information read [this](http://support.fastsms.co.uk/knowledgebase/http-documentation/#DeleteAllContacts)

```
...
use FastSMS\Model\Contact;
...
// Get report
$result = $client->contact->deleteAll();

```

### Delete All Groups

[](#delete-all-groups)

More information read [this](http://support.fastsms.co.uk/knowledgebase/http-documentation/#DeleteAllGroups)

```
...
use FastSMS\Model\Contact;
...
// Get report
$result = $client->group->deleteAll();

```

### Empty Group

[](#empty-group)

Remove all contacts from the specified group. More information read [this](http://support.fastsms.co.uk/knowledgebase/http-documentation/#EmptyGroup)

```
...
use FastSMS\Model\Contact;
...
// Get report
$result = $client->group->empty('Group Name');

```

### Delete Group

[](#delete-group)

Delete the specified group. More information read [this](http://support.fastsms.co.uk/knowledgebase/http-documentation/#DeleteGroup)

```
...
use FastSMS\Model\Contact;
...
// Get report
$result = $client->group->delete('Group Name');

```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% 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 ~112 days

Recently: every ~220 days

Total

10

Last Release

3001d ago

Major Versions

v0.2.1 → 1.0.02015-06-18

PHP version history (2 changes)0.1.0-alpha1PHP &gt;=5.4.0

v0.2.1PHP &gt;=5.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a3f80ddd7798f49642e05388644ff6486f2798a2183ed75d4cb79363da84cae?d=identicon)[ruslan.tabachuk](/maintainers/ruslan.tabachuk)

---

Top Contributors

[![ruslan-tabachuk](https://avatars.githubusercontent.com/u/12623480?v=4)](https://github.com/ruslan-tabachuk "ruslan-tabachuk (52 commits)")[![DaveWishesHe](https://avatars.githubusercontent.com/u/4179596?v=4)](https://github.com/DaveWishesHe "DaveWishesHe (1 commits)")

---

Tags

apisdksmsnewsletterfastsms

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fastsms-sdk/health.svg)

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

PHPackages © 2026

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