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

ActiveLibrary[API Development](/categories/api)

smsfire/php-sdk
===============

SDK for all SMSFIRE services

1.3.0(4y ago)113MITPHPPHP &gt;=7.1.0

Since Nov 18Pushed 4y ago1 watchersCompare

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

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

SMSFIRE PHP SDK
===============

[](#smsfire-php-sdk)

[![Version](https://camo.githubusercontent.com/5052b6b461e6173d113d21f4bb858075de507041c13b444593f7fc50ec9294bd/687474703a2f2f706f7365722e707567782e6f72672f736d73666972652f7068702d73646b2f76657273696f6e)](https://packagist.org/packages/smsfire/php-sdk)[![Total Downloads](https://camo.githubusercontent.com/be7ea9a7a7c85046ca51838da735d0f2665cce6534a1f9a308e232186d92beb0/687474703a2f2f706f7365722e707567782e6f72672f736d73666972652f7068702d73646b2f646f776e6c6f616473)](https://packagist.org/packages/smsfire/php-sdk)[![PHP Version Require](https://camo.githubusercontent.com/548fa9430c216a88a3efd8680d14e7a8b42b45dfb4c93e83886b00f8669e8f0e/687474703a2f2f706f7365722e707567782e6f72672f736d73666972652f7068702d73646b2f726571756972652f706870)](https://packagist.org/packages/smsfire/php-sdk)

Requirements
============

[](#requirements)

- Composer &gt; 2+
- PHP &gt;= 7.1.0
- User and pass ([Register here](https://smsfire.com.br))

Installation
============

[](#installation)

You can install **php-sdk** via composer or by downloading the source.

Composer
--------

[](#composer)

**php-sdk** is available on Packagist as the **smsfire/php-sdk** package:

```
composer require smsfire/php-sdk

```

SMS Services
============

[](#sms-services)

The reference of this service can be found [here](https://docs.smsfire.com.br/apis-sms)

💬 [Messages Service](#namespace---smsfiresmsmessages)
📬 [Inbox Service](#namespace---smsfiresmsinbox)
☑️ [Status Service](#namespace---smsfiresmsstatus)

Namespace - Smsfire\\Sms\\Messages
----------------------------------

[](#namespace---smsfiresmsmessages)

This namespace allows you to send SMS messages.

- [sendIndividual()](#send-individual-message---sendindividual) - Send individual sms message
- [sendBulk()](#send-bulk-messages---sendbulk) - Send bulk sms messages

> ### Receiving messages (MO)
>
> [](#receiving-messages-mo)
>
> When you set as **true** the `allowReply` param on [sendIndividual()](#send-individual-message---sendindividual) or [sendBulk()](#send-bulk-messages---sendbulk) messaging methods, your account may have additional costs per each received message. Contact your account manager to know more about it.
>
> ### Flash messages - Class 0
>
> [](#flash-messages---class-0)
>
> The `flash` param depends of route that were settled on your account as well of each carrier's availability for this feature. Contact your account manager to know more about it.

### Send individual message - sendIndividual()

[](#send-individual-message---sendindividual)

Access the [reference docs](https://docs.smsfire.com.br/apis-sms/enviar-mensagem#http-simplificado) to check the data response and the details of each parameter of this method.

#### Guide of available parameters on this method

[](#guide-of-available-parameters-on-this-method)

ParamTypeDescriptionConditionRequired**to***string*Phone at international syntaxMax of 15 characters✅**text***string*SMS messageMax of 765 characters✅**from***string*Remitent of smsMax of 11 characters❌**customId***string*Set your own idMax of 40 characters❌**campaignId***int*Merge messages into existent campaign-❌**flash***bool*Send message on flash mode - Check availabilityDefault: false❌**allowReply***bool*Allow gateway to capture reply from your messagesDefault: false❌**scheduleTime***string*Schedule message on given datetimeDatetime ISO8601❌**debug***bool*Debug API requestDefault: false❌### Example

[](#example)

```
//Load composer autoload file
require './vendor/autoload.php';

use Smsfire\Sms\Messages;
use Smsfire\Exceptions\SmsfireException;
use Smsfire\Exceptions\HttpException;

try {

    $user = 'myuser'; //Same user that is used to access Dashboard
    $pass = 'mypass'; //Same password that is used to access Dashboard
    $token = base64_encode("{$user}:{$pass}");

    /**
     * Pass base64 token on Message instance
     * Check guide table of params
     */
    $messagesService = new Messages($token);
    $response = $messagesService->sendIndividual(
      $to,
      $text,
      $from,
      $customId,
      $campaignId,
      $flash,
      $allowReply,
      $scheduleTime,
      $debug
    );

    /**
     * Response as raw text
     * Good to use when Debug option is true
     */
    echo $response;

    //Response with the statusCode of Http response
    echo $response->statusCode();

    //Response as json string
    echo $response->__toJson();

    //Response as object
    print_r($response->__toObject());

    //Response as array
    print_r($response->__toArray());

} catch (SmsfireException $e) {
    echo $e->getMessage();
} catch (HttpException $e) {
    echo $e->getMessage();
} catch (Exception $e) {
    echo $e->getMessage();
}
```

### Send bulk messages - sendBulk()

[](#send-bulk-messages---sendbulk)

Access the [reference docs](https://docs.smsfire.com.br/apis-sms/enviar-mensagem#rest-json) to check the data response and the details of each parameter of this method.

#### Guide of available parameters on this method

[](#guide-of-available-parameters-on-this-method-1)

ParamTypeDescriptionConditionRequired**destinations***array*Array of destinations to messageMin of 2 items and Max of 1000 items✅**destinations\[\*\].to***string*Phone at international syntaxMax of 15 characters✅**destinations\[\*\].text***string*SMS messageMax of 765 characters✅**destinations\[\*\].from***string*Remitent of SMSMax of 11 characters❌**destinations\[\*\].customId***string*Set your own idMax of 40 characters❌**destinations\[\*\].flash***bool*Send message on flash mode - Check availabilityDefault: false❌**allowReply***bool*Allow gateway to capture reply from your messagesDefault: false❌**scheduleTime***string*Schedule message on given datetimeDatetime ISO8601❌**debug***bool*Debug API requestDefault: false❌### Example

[](#example-1)

```
//Load composer autoload file
require './vendor/autoload.php';

use Smsfire\Sms\Messages;
use Smsfire\Exceptions\SmsfireException;
use Smsfire\Exceptions\HttpException;

try {

    $user = 'myuser'; //Same user that is used to access Dashboard
    $pass = 'mypass'; //Same password that is used to access Dashboard
    $token = base64_encode("{$user}:{$pass}");

    //Pass base64 token on Message instance
    $messagesService = new Messages($token);

    //Minimum of two items to use Bulk request
    $destinations = [
      [
        'to' => '5511944556677',
        'text' => 'My first message',
        'customId' => 'abc-00001',
        'flash' => true
      ],
      [
        'to' => '5565988887777',
        'text' => 'My second message'
      ]
    ];

    $response = $messagesService->sendBulk(
        $destinations,
        $campaignId,
        $allowReply,
        $scheduleTime,
        $debug
    );

    /**
     * Response as raw text
     * Good to use when Debug option is true
     */
    echo $response;

    //Response with the statusCode of Http response
    echo $response->statusCode();

    //Response as json string
    echo $response->__toJson();

    //Response as object
    print_r($response->__toObject());

    //Response as array
    print_r($response->__toArray());

} catch (SmsfireException $e) {
    echo $e->getMessage();
} catch (HttpException $e) {
    echo $e->getMessage();
} catch (Exception $e) {
    echo $e->getMessage();
}
```

Namespace - Smsfire\\Sms\\Inbox
-------------------------------

[](#namespace---smsfiresmsinbox)

This namespace allows you to get received messages from your sms inbox.

- [getAll()](#get-all-messages---getall) - Get read and unread messages
- [getUnread()](#get-unread-messages---getunread) - Get unread messages

Access the [reference docs](https://docs.smsfire.com.br/apis-sms/inbox) to check the data response and the details of each parameter of this method.

> #### The statusCode 204 will be given when your inbox has no messages. [**REF. 204 No Content**](https://developer.mozilla.org/pt-BR/docs/Web/HTTP/Status/204)
>
> [](#the-statuscode-204-will-be-given-when-your-inbox-has-no-messages-ref-204-no-content)

### Get all messages - getAll()

[](#get-all-messages---getall)

### Example

[](#example-2)

```
//Load composer autoload file
require './vendor/autoload.php';

use Smsfire\Sms\Inbox;
use Smsfire\Exceptions\SmsfireException;
use Smsfire\Exceptions\HttpException;

try {

    $debug = false;    //Debug API request - DEFAULT: false
    $user  = 'myuser'; //Same user that is used to access Dashboard
    $pass  = 'mypass'; //Same password that is used to access Dashboard
    $token = base64_encode("{$user}:{$pass}");

    /**
     * Pass base64 token on Inbox instance
     * Check guide table of params
     */
    $inboxServices = new Inbox($token);
    $response = $inboxServices->getAll($debug);

    /**
     * Response as raw text
     * Good to use when Debug option is true
     */
    echo $response;

    //Response with the statusCode of Http response
    echo $response->statusCode();

    //Response as json string
    echo $response->__toJson();

    //Response as object
    print_r($response->__toObject());

    //Response as array
    print_r($response->__toArray());

    //Handle empty inbox
    if($response->statusCode() === 204) {
      echo "Empty inbox";
    }

} catch (SmsfireException $e) {
    echo $e->getMessage();
} catch (HttpException $e) {
    echo $e->getMessage();
} catch (Exception $e) {
    echo $e->getMessage();
}
```

> Due API limitations this method will expose the **last 100 received messages** of your inbox. For more, access the [Portal SMSFire](https://v2.smsfire.com.br) and access it on menu SMS &gt; Inbox

### Get unread messages - getUnread()

[](#get-unread-messages---getunread)

### Example

[](#example-3)

```
//Load composer autoload file
require './vendor/autoload.php';

use Smsfire\Sms\Inbox;
use Smsfire\Exceptions\SmsfireException;
use Smsfire\Exceptions\HttpException;

try {

    $debug = false;    //Debug API request - DEFAULT: false
    $user  = 'myuser'; //Same user that is used to access Dashboard
    $pass  = 'mypass'; //Same password that is used to access Dashboard
    $token = base64_encode("{$user}:{$pass}");

    /**
     * Pass base64 token on Inbox instance
     * Check guide table of params
     */
    $inboxServices = new Inbox($token);
    $response = $inboxServices->getUnread($debug);

    /**
     * Response as raw text
     * Good to use when Debug option is true
     */
    echo $response;

    //Response with the statusCode of Http response
    echo $response->statusCode();

    //Response as json string
    echo $response->__toJson();

    //Response as object
    print_r($response->__toObject());

    //Response as array
    print_r($response->__toArray());

    //Handle empty inbox
    if($response->statusCode() === 204) {
      echo "Empty inbox";
    }

} catch (SmsfireException $e) {
    echo $e->getMessage();
} catch (HttpException $e) {
    echo $e->getMessage();
} catch (Exception $e) {
    echo $e->getMessage();
}
```

Namespace - Smsfire\\Sms\\Status
--------------------------------

[](#namespace---smsfiresmsstatus)

This namespace allows you to get messages status by `id` or given `customId`

- [messageIds()](#get-messages-status-by-id---messageids) - Get messages status by id
- [customIds()](#get-messages-status-by-customid---customids) - Get messages status by customId

Access the [reference docs](https://docs.smsfire.com.br/apis-sms/consulta-status) to check the data response and the details of each parameter of this method.

> #### The statusCode 204 will be given when given id or customId does not exist. [**REF. 204 No Content**](https://developer.mozilla.org/pt-BR/docs/Web/HTTP/Status/204)
>
> [](#the-statuscode-204-will-be-given-when-given-id-or-customid-does-not-exist-ref-204-no-content)

### Get messages status by id - messageIds()

[](#get-messages-status-by-id---messageids)

#### Guide of available parameters on this method

[](#guide-of-available-parameters-on-this-method-2)

ParamTypeDescriptionConditionRequired**ids***string*String with messages ids (Comma separated)Min of 1 and max of 200 Ids✅**debug***bool*Debug API requestDefault: false❌### Example

[](#example-4)

```
//Load composer autoload file
require './vendor/autoload.php';

use Smsfire\Sms\Status;
use Smsfire\Exceptions\SmsfireException;
use Smsfire\Exceptions\HttpException;

try {

    $user  = 'myuser'; //Same user that is used to access Dashboard
    $pass  = 'mypass'; //Same password that is used to access Dashboard
    $token = base64_encode("{$user}:{$pass}");

    /**
     * Pass base64 token on Status instance
     * Check guide table of params
     */
    $messagesStatus = new Status($token);
    $ids = "000001,000002,000003"; //Messages ids - Comma separated
    $response = $messagesStatus->messageIds($ids, $debug);

    /**
     * Response as raw text
     * Good to use when Debug option is true
     */
    echo $response;

    //Response with the statusCode of Http response
    echo $response->statusCode();

    //Response as json string
    echo $response->__toJson();

    //Response as object
    print_r($response->__toObject());

    //Response as array
    print_r($response->__toArray());

    //Handle empty result
    if($response->statusCode() === 204) {
      echo "Message id does not exist";
    }

} catch (SmsfireException $e) {
    echo $e->getMessage();
} catch (HttpException $e) {
    echo $e->getMessage();
} catch (Exception $e) {
    echo $e->getMessage();
}
```

> Due API limitations this method will accepts the maximum of **200 messages ids**. For more, access the [Portal SMSFire](https://v2.smsfire.com.br) and access it on menu SMS &gt; Reports

### Get messages status by customId - customIds()

[](#get-messages-status-by-customid---customids)

#### Guide of available parameters on this method

[](#guide-of-available-parameters-on-this-method-3)

ParamTypeDescriptionConditionRequired**customIds***string*String with custom id of messages (Comma separated)Min of 1 and max of 200 custom ids✅**debug***bool*Debug API requestDefault: false❌### Example

[](#example-5)

```
//Load composer autoload file
require './vendor/autoload.php';

use Smsfire\Sms\Status;
use Smsfire\Exceptions\SmsfireException;
use Smsfire\Exceptions\HttpException;

try {

    $user  = 'myuser'; //Same user that is used to access Dashboard
    $pass  = 'mypass'; //Same password that is used to access Dashboard
    $token = base64_encode("{$user}:{$pass}");

    /**
     * Pass base64 token on Status instance
     * Check guide table of params
     */
    $messagesStatus = new Status($token);
    $customIds = "myid0001,myid000002,myid000003"; //Custom ids - Comma separated
    $response = $messagesStatus->customIds($customIds, $debug);

    /**
     * Response as raw text
     * Good to use when Debug option is true
     */
    echo $response;

    //Response with the statusCode of Http response
    echo $response->statusCode();

    //Response as json string
    echo $response->__toJson();

    //Response as object
    print_r($response->__toObject());

    //Response as array
    print_r($response->__toArray());

    //Handle empty result
    if($response->statusCode() === 204) {
      echo "Custom id does not exist";
    }

} catch (SmsfireException $e) {
    echo $e->getMessage();
} catch (HttpException $e) {
    echo $e->getMessage();
} catch (Exception $e) {
    echo $e->getMessage();
}
```

Namespace - Smsfire\\Exceptions
-------------------------------

[](#namespace---smsfireexceptions)

Custom exceptions that allows you a better error handling.

### SmsfireException

[](#smsfireexception)

This will be thrown when any SDK required types and data were not meet.

### HttpException

[](#httpexception)

This will be thrown when the core API has some request problem as timeout or bad data for example.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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 ~1 days

Total

4

Last Release

1638d ago

### Community

Maintainers

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

---

Top Contributors

[![smsfire](https://avatars.githubusercontent.com/u/94476340?v=4)](https://github.com/smsfire "smsfire (84 commits)")

---

Tags

apismswhatsappBigDatasmsfire

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35636.1k2](/packages/telnyx-telnyx-php)[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)[melipayamak/php

A PHP wrapper for melipayamak's web services

3294.4k5](/packages/melipayamak-php)[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)
