PHPackages                             gsmservice-pl/messaging-sdk-php - 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. gsmservice-pl/messaging-sdk-php

ActiveLibrary

gsmservice-pl/messaging-sdk-php
===============================

v3.2.3(4mo ago)1352↓50%1MITPHPPHP &gt;=8.2

Since Oct 12Pushed 4mo agoCompare

[ Source](https://github.com/gsmservice-pl/messaging-sdk-php)[ Packagist](https://packagist.org/packages/gsmservice-pl/messaging-sdk-php)[ RSS](/packages/gsmservice-pl-messaging-sdk-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (10)Versions (8)Used By (1)

[![Packagist Version](https://camo.githubusercontent.com/f227195573b730cdb03b6f611a2fc05b2615a317e3a695ccf4c8b6adb7a54861/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67736d736572766963652d706c2f6d6573736167696e672d73646b2d706870)](https://packagist.org/packages/gsmservice-pl/messaging-sdk-php)[![GitHub License](https://camo.githubusercontent.com/671d82acadcee7a12e94c5f682fda7e98f571f8db44b4db5f25e83039c750a66/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f67736d736572766963652d706c2f6d6573736167696e672d73646b2d706870)](https://github.com/gsmservice-pl/messaging-sdk-php/blob/main/LICENSE)[![Static Badge](https://camo.githubusercontent.com/f20375bebe19b99deaa71ef853e5ad67634ed5e161d45df58e3349bd50af9d5a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c745f62792d537065616b656173792d79656c6c6f77)](https://www.speakeasy.com/?utm_source=gsmservice-pl/messaging-sdk-php&utm_campaign=php)

SzybkiSMS.pl Messaging REST API SDK for PHP (powered by GSMService.pl)
======================================================================

[](#szybkismspl-messaging-rest-api-sdk-for-php-powered-by-gsmservicepl)

This package includes Messaging SDK for PHP (&gt;8.2) to send SMS &amp; MMS messages directly from your app via  messaging platform.

Additional documentation:
-------------------------

[](#additional-documentation)

A documentation of all methods and types is available below in section [Available Resources and Operations ](#available-resources-and-operations).

Also you can refer to the [REST API documentation](https://api.szybkisms.pl/rest/) for additional details about the basics of this SDK.

Table of Contents
-----------------

[](#table-of-contents)

- [SzybkiSMS.pl Messaging REST API SDK for PHP (powered by GSMService.pl)](#szybkismspl-messaging-rest-api-sdk-for-php-powered-by-gsmservicepl)
    - [Additional documentation:](#additional-documentation)
    - [SDK Installation](#sdk-installation)
    - [Requeirements:](#requeirements)
    - [SDK Example Usage](#sdk-example-usage)
    - [Authentication](#authentication)
    - [Available Resources and Operations](#available-resources-and-operations)
    - [Retries](#retries)
    - [Error Handling](#error-handling)
    - [Server Selection](#server-selection)
- [Development](#development)
    - [Maturity](#maturity)
    - [Contributions](#contributions)

SDK Installation
----------------

[](#sdk-installation)

The SDK relies on [Composer](https://getcomposer.org/) to manage its dependencies.

To install the SDK and add it as a dependency to an existing `composer.json` file:

```
composer require "gsmservice-pl/messaging-sdk-php"
```

Requeirements:
--------------

[](#requeirements)

- Minimal PHP version: 8.2

SDK Example Usage
-----------------

[](#sdk-example-usage)

### Sending single SMS Message

[](#sending-single-sms-message)

This example demonstrates simple sending SMS message to a single recipient:

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Gsmservice\Gateway;
use Gsmservice\Gateway\Models\Components;

$sdk = Gateway\Client::builder()
    ->setSecurity(
        ''
    )
    ->build();

$request = new Components\SmsMessage(
    recipients: '+48999999999',
    message: 'This is SMS message content.',
    unicode: true,
);

$response = $sdk->outgoing->sms->send(
    request: $request
);

if ($response->messages !== null) {
    // handle response
}
```

### Sending single MMS Message

[](#sending-single-mms-message)

This example demonstrates simple sending MMS message to a single recipient:

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Gsmservice\Gateway;
use Gsmservice\Gateway\Models\Components;

$sdk = Gateway\Client::builder()
    ->setSecurity(
        ''
    )
    ->build();

$request = new Components\MmsMessage(
    recipients: '+48999999999',
    subject: 'This is a subject of the message',
    message: 'This is MMS message content.',
    attachments: '',
);

$response = $sdk->outgoing->mms->send(
    request: $request
);

if ($response->messages !== null) {
    // handle response
}
```

Authentication
--------------

[](#authentication)

### Per-Client Security Schemes

[](#per-client-security-schemes)

This SDK supports the following security scheme globally:

NameTypeScheme`bearer`httpHTTP BearerTo authenticate with the API the `bearer` parameter must be set when initializing the SDK. For example:

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Gsmservice\Gateway;

$sdk = Gateway\Client::builder()
    ->setSecurity(
        ''
    )
    ->build();

$response = $sdk->accounts->get(

);

if ($response->accountResponse !== null) {
    // handle response
}
```

Available Resources and Operations
----------------------------------

[](#available-resources-and-operations)

Available methods### [Accounts](docs/sdks/accounts/README.md)

[](#accounts)

- [get](docs/sdks/accounts/README.md#get) - Get account details
- [getSubaccount](docs/sdks/accounts/README.md#getsubaccount) - Get subaccount details

### [Common](docs/sdks/common/README.md)

[](#common)

- [ping](docs/sdks/common/README.md#ping) - Checks API availability and version

### [Incoming](docs/sdks/incoming/README.md)

[](#incoming)

- [list](docs/sdks/incoming/README.md#list) - List the received SMS messages
- [getByIds](docs/sdks/incoming/README.md#getbyids) - Get the incoming messages by IDs
- [removeByIds](docs/sdks/incoming/README.md#removebyids) - Remove the incoming messages from your inbox

### [Outgoing](docs/sdks/outgoing/README.md)

[](#outgoing)

- [getByIds](docs/sdks/outgoing/README.md#getbyids) - Get the messages details and status by IDs
- [cancelScheduled](docs/sdks/outgoing/README.md#cancelscheduled) - Cancel a scheduled messages
- [list](docs/sdks/outgoing/README.md#list) - Lists the history of sent messages

#### [Outgoing.Mms](docs/sdks/mms/README.md)

[](#outgoingmms)

- [getPrice](docs/sdks/mms/README.md#getprice) - Check the price of MMS Messages
- [send](docs/sdks/mms/README.md#send) - Send MMS Messages

#### [Outgoing.Sms](docs/sdks/sms/README.md)

[](#outgoingsms)

- [getPrice](docs/sdks/sms/README.md#getprice) - Check the price of SMS Messages
- [send](docs/sdks/sms/README.md#send) - Send SMS Messages

### [Senders](docs/sdks/senders/README.md)

[](#senders)

- [list](docs/sdks/senders/README.md#list) - List allowed senders names
- [add](docs/sdks/senders/README.md#add) - Add a new sender name
- [delete](docs/sdks/senders/README.md#delete) - Delete a sender name
- [setDefault](docs/sdks/senders/README.md#setdefault) - Set default sender name

Retries
-------

[](#retries)

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide an `Options` object built with a `RetryConfig` object to the call:

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Gsmservice\Gateway;
use Gsmservice\Gateway\Utils\Retry;

$sdk = Gateway\Client::builder()
    ->setSecurity(
        ''
    )
    ->build();

$response = $sdk->accounts->get(
    options: Utils\Options->builder()->setRetryConfig(
        new Retry\RetryConfigBackoff(
            initialInterval: 1,
            maxInterval:     50,
            exponent:        1.1,
            maxElapsedTime:  100,
            retryConnectionErrors: false,
        ))->build()
);

if ($response->accountResponse !== null) {
    // handle response
}
```

If you'd like to override the default retry strategy for all operations that support retries, you can pass a `RetryConfig` object to the `SDKBuilder->setRetryConfig` function when initializing the SDK:

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Gsmservice\Gateway;
use Gsmservice\Gateway\Utils\Retry;

$sdk = Gateway\Client::builder()
    ->setRetryConfig(
        new Retry\RetryConfigBackoff(
            initialInterval: 1,
            maxInterval:     50,
            exponent:        1.1,
            maxElapsedTime:  100,
            retryConnectionErrors: false,
        )
  )
    ->setSecurity(
        ''
    )
    ->build();

$response = $sdk->accounts->get(

);

if ($response->accountResponse !== null) {
    // handle response
}
```

Error Handling
--------------

[](#error-handling)

Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.

By default an API error will raise a `Errors\SDKException` exception, which has the following properties:

PropertyTypeDescription`$message`*string*The error message`$statusCode`*int*The HTTP status code`$rawResponse`*?\\Psr\\Http\\Message\\ResponseInterface*The raw HTTP response`$body`*string*The response contentWhen custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `get` method throws the following exceptions:

Error TypeStatus CodeContent TypeErrors\\ErrorResponse401, 403, 4XXapplication/problem+jsonErrors\\ErrorResponse5XXapplication/problem+json### Example

[](#example)

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Gsmservice\Gateway;
use Gsmservice\Gateway\Models\Errors;

$sdk = Gateway\Client::builder()
    ->setSecurity(
        ''
    )
    ->build();

try {
    $response = $sdk->accounts->get(

    );

    if ($response->accountResponse !== null) {
        // handle response
    }
} catch (Errors\ErrorResponseThrowable $e) {
    // handle $e->$container data
    throw $e;
} catch (Errors\ErrorResponseThrowable $e) {
    // handle $e->$container data
    throw $e;
} catch (Errors\SDKException $e) {
    // handle default exception
    throw $e;
}
```

Server Selection
----------------

[](#server-selection)

### Select Server by Name

[](#select-server-by-name)

You can override the default server globally using the `setServer(string $serverName)` builder method when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:

NameServerDescription`prod``https://api.szybkisms.pl/rest`Production system`sandbox``https://api.szybkisms.pl/rest-sandbox`Test system (SANDBOX)#### Example

[](#example-1)

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Gsmservice\Gateway;

$sdk = Gateway\Client::builder()
    ->setServer('prod')
    ->setSecurity(
        ''
    )
    ->build();

$response = $sdk->accounts->get(

);

if ($response->accountResponse !== null) {
    // handle response
}
```

### Override Server URL Per-Client

[](#override-server-url-per-client)

The default server can also be overridden globally using the `setServerUrl(string $serverUrl)` builder method when initializing the SDK client instance. For example:

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Gsmservice\Gateway;

$sdk = Gateway\Client::builder()
    ->setServerURL('https://api.szybkisms.pl/rest')
    ->setSecurity(
        ''
    )
    ->build();

$response = $sdk->accounts->get(

);

if ($response->accountResponse !== null) {
    // handle response
}
```

Development
===========

[](#development)

Maturity
--------

[](#maturity)

This SDK is in continuous development and there may be breaking changes between a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions
-------------

[](#contributions)

While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance78

Regular maintenance activity

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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

Recently: every ~103 days

Total

7

Last Release

149d ago

Major Versions

v0.38.26 → v1.0.12024-10-14

v1.0.1 → v2.0.92024-10-24

v2.1.5 → v3.0.12025-03-05

PHP version history (2 changes)v0.38.26PHP ^8.2

v3.1.2PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f1fc8c67f77ed70a60610cf83536d4f9a323ead0cdef3813f1f4f90609309a1?d=identicon)[gsmservice](/maintainers/gsmservice)

---

Top Contributors

[![tommekk83](https://avatars.githubusercontent.com/u/130782947?v=4)](https://github.com/tommekk83 "tommekk83 (34 commits)")

---

Tags

bramkagatewaymessagesmessagingphpsdksms

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gsmservice-pl-messaging-sdk-php/health.svg)

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

###  Alternatives

[clerkinc/backend-php

2755.0k](/packages/clerkinc-backend-php)[polar-sh/sdk

4014.5k4](/packages/polar-sh-sdk)[dnsimple/dnsimple

The DNSimple API client for PHP.

11190.9k1](/packages/dnsimple-dnsimple)

PHPackages © 2026

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