PHPackages                             serwersms/serwersmsbundle - 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. serwersms/serwersmsbundle

ActiveSymfony-bundle[API Development](/categories/api)

serwersms/serwersmsbundle
=========================

Symfony 8.1 Bundle for communication with the API v2 SerwerSMS.pl

v2.0.1(1w ago)212.3k6[3 issues](https://github.com/SerwerSMSpl/serwersms-symfony-bundle/issues)[1 PRs](https://github.com/SerwerSMSpl/serwersms-symfony-bundle/pulls)Apache-2.0PHPPHP &gt;=8.4

Since May 24Pushed 1w ago1 watchersCompare

[ Source](https://github.com/SerwerSMSpl/serwersms-symfony-bundle)[ Packagist](https://packagist.org/packages/serwersms/serwersmsbundle)[ Docs](https://serwersms.pl/)[ RSS](/packages/serwersms-serwersmsbundle/feed)WikiDiscussions master Synced today

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

SerwerSMSBundle - Symfony
=========================

[](#serwersmsbundle---symfony)

Klient PHP dla frameworka Symfony do komunikacji z API v2 SerwerSMS.pl

Zalecane jest, aby komunikacja przez HTTPS API odbywała się z loginów utworzonych specjalnie do połączenia przez API. Konto użytkownika API można utworzyć w Panelu Klienta → Ustawienia interfejsów → HTTP API → Użytkownicy API.

Wymagania
---------

[](#wymagania)

- PHP &gt;= 8.4
- Symfony &gt;= 8.1

Instalacja
----------

[](#instalacja)

Przez Composer:

```
composer require serwersms/serwersmsbundle
```

Lub ręcznie w `composer.json`:

```
{
    "require": {
        "serwersms/serwersmsbundle": "^2.0"
    }
}
```

Konfiguracja
------------

[](#konfiguracja)

### Opcja 1 — autentykacja przez token

[](#opcja-1--autentykacja-przez-token)

```
# config/packages/serwer_sms.yaml
serwer_sms:
    serwersms_token: '%env(SERWERSMS_TOKEN)%'
```

### Opcja 2 — autentykacja przez username i password

[](#opcja-2--autentykacja-przez-username-i-password)

```
# config/packages/serwer_sms.yaml
serwer_sms:
    serwersms_username: '%env(SERWERSMS_USERNAME)%'
    serwersms_password: '%env(SERWERSMS_PASSWORD)%'
```

Opcjonalne parametry dla obu opcji:

```
serwer_sms:
    # ...
    serwersms_api_url: 'https://api2.serwersms.pl'  # domyślnie
    serwersms_timeout: 30                            # domyślnie
```

### Opcja 3 — rejestracja ręczna w services.yaml

[](#opcja-3--rejestracja-ręczna-w-servicesyaml)

Zamiast konfiguracji bundla, klasę można zarejestrować bezpośrednio jako serwis Symfony:

Z tokenem:

```
# config/services.yaml
services:
    serwer_sms:
        class: SerwerSMS\SerwerSMSBundle\SerwerSMSToken
        public: true
        arguments:
            - '%env(SERWERSMS_TOKEN)%'

    SerwerSMS\SerwerSMSBundle\SerwerSMSInterface: '@serwer_sms'
```

Z username i password:

```
# config/services.yaml
services:
    serwer_sms:
        class: SerwerSMS\SerwerSMSBundle\SerwerSMS
        public: true
        arguments:
            - '%env(SERWERSMS_USERNAME)%'
            - '%env(SERWERSMS_PASSWORD)%'

    SerwerSMS\SerwerSMSBundle\SerwerSMSInterface: '@serwer_sms'
```

Użycie w kontrolerze
--------------------

[](#użycie-w-kontrolerze)

```
namespace App\Controller;

use SerwerSMS\SerwerSMSBundle\SerwerSMSInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Attribute\Route;

class SmsController extends AbstractController
{
    public function __construct(private SerwerSMSInterface $serwerSms)
    {
    }

    #[Route('/send-sms')]
    public function sendSms(): JsonResponse
    {
        try {

            $result = $this->serwerSms->messages()->sendSms(
                [
                    '+48500600700',
                    '+48600700800'
                 ],
                'Test FULL message',
                'INFORMACJA',
                [
                    'test' => true,
                    'details' => true
                ]
            );

            return new JsonResponse($result);

        } catch (\Exception $e) {
            return new JsonResponse(['error' => $e->getMessage()], 500);
        }
    }
}
```

Przykłady
---------

[](#przykłady)

```
try {

    // SMS FULL
    $result = $this->serwerSms->messages()->sendSms(
        [
            '+48500600700',
            '+48600700800'
        ],
        'Test FULL message',
        'INFORMACJA',
        [
            'test' => true,
            'details' => true
        ]
    );

    // SMS ECO
    $result = $this->serwerSms->messages()->sendSms(
        [
            '+48500600700',
            '+48600700800'
        ],
        'Test ECO message',
        null,
        [
            'test' => true,
            'details' => true
        ]
    );

    // VOICE from text
    $result = $this->serwerSms->messages()->sendVoice(
        [
            '+48500600700',
            '+48600700800'
        ],
        [
            'text' => 'Test message',
            'test' => true,
            'details' => true
        ]
    );

    // MMS
    $list = $this->serwerSms->files()->index('mms');
    $result = $this->serwerSms->messages()->sendMms(
        [
            '+48500600700',
            '+48600700800'
        ],
        'MMS Title',
        [
            'test' => true,
            'file_id' => $list->items[0]->id,
            'details' => true
        ]
    );

    echo 'Skolejkowano: ' . $result->queued . '';
    echo 'Niewysłano: ' . $result->unsent . '';

    foreach ($result->items as $sms) {
        echo 'ID: ' . $sms->id . '';
        echo 'NUMER: ' . $sms->phone . '';
        echo 'STATUS: ' . $sms->status . '';
        echo 'CZĘŚCI: ' . $sms->parts . '';
        echo 'WIADOMOŚĆ: ' . $sms->text . '';
    }

} catch (\Exception $e) {
    echo 'ERROR: ' . $e->getMessage();
}
```

### Wysyłka spersonalizowanych SMS

[](#wysyłka-spersonalizowanych-sms)

```
try {

    $messages[] = [
        'phone' => '500600700',
        'text' => 'First message'
    ];
    $messages[] = [
        'phone' => '600700800',
        'text' => 'Second message'
    ];

    $result = $this->serwerSms->messages()->sendPersonalized(
        $messages,
        'INFORMACJA',
        [
            'test' => true,
            'details' => true
        ]
    );

    echo 'Skolejkowano: ' . $result->queued . '';
    echo 'Niewysłano: ' . $result->unsent . '';

    foreach ($result->items as $sms) {
        echo 'ID: ' . $sms->id . '';
        echo 'NUMER: ' . $sms->phone . '';
        echo 'STATUS: ' . $sms->status . '';
        echo 'CZĘŚCI: ' . $sms->parts . '';
        echo 'WIADOMOŚĆ: ' . $sms->text . '';
    }

} catch (\Exception $e) {
    echo 'ERROR: ' . $e->getMessage();
}
```

### Pobieranie raportów doręczeń

[](#pobieranie-raportów-doręczeń)

```
try {

    $result = $this->serwerSms->messages()->reports(['id' => ['aca3944055']]);

    foreach ($result->items as $sms) {
        echo 'ID: ' . $sms->id . '';
        echo 'NUMER: ' . $sms->phone . '';
        echo 'STATUS: ' . $sms->status . '';
        echo 'SKOLEJKOWANO: '. $sms->queued . '';
        echo 'WYSŁANO: ' . $sms->sent . '';
        echo 'DORĘCZONO: ' . $sms->delivered . '';
        echo 'NADAWCA: ' . $sms->sender . '';
        echo 'TYP: ' . $sms->type . '';
        echo 'WIADOMOŚĆ: ' . $sms->text . '';
    }

} catch (\Exception $e) {
    echo 'ERROR: ' . $e->getMessage();
}
```

### Pobieranie wiadomości przychodzących

[](#pobieranie-wiadomości-przychodzących)

```
try {

    $result = $this->serwerSms->messages()->received('ndi');

    foreach ($result->items as $sms) {
        echo 'ID: ' . $sms->id . '';
        echo 'TYP: ' . $sms->type . '';
        echo 'NUMER: ' . $sms->phone . '';
        echo 'DATA: ' . $sms->received . '';
        echo 'CZARNA LISTA: ' . $sms->blacklist . '';
        echo 'WIADOMOŚĆ: ' . $sms->text . '';
    }

} catch (\Exception $e) {
    echo 'ERROR: ' . $e->getMessage();
}
```

Dokumentacja API
----------------

[](#dokumentacja-api)

Konsola API:

###  Health Score

53

↑

FairBetter than 96% of packages

Maintenance78

Regular maintenance activity

Popularity27

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

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

Total

4

Last Release

10d ago

Major Versions

1.0.4 → v2.0.12026-06-23

PHP version history (2 changes)1.0.2PHP &gt;=5.3.9

v2.0.1PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/635e49d7360c710e89db0936e781e747f34342609d7d29a05eb060a78bb556bb?d=identicon)[SerwerSMSpl](/maintainers/SerwerSMSpl)

---

Top Contributors

[![SerwerSMSpl](https://avatars.githubusercontent.com/u/7964146?v=4)](https://github.com/SerwerSMSpl "SerwerSMSpl (16 commits)")

---

Tags

apisymfonysmsserwersms

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/serwersms-serwersmsbundle/health.svg)

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[symfony/web-profiler-bundle

Provides a development tool that gives detailed information about the execution of any request

2.3k160.5M1.2k](/packages/symfony-web-profiler-bundle)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

515100.5k3](/packages/web-auth-webauthn-framework)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[web-auth/webauthn-symfony-bundle

FIDO2/Webauthn Security Bundle For Symfony

66529.9k11](/packages/web-auth-webauthn-symfony-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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