PHPackages                             phpinfo/smsfeedback - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phpinfo/smsfeedback

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phpinfo/smsfeedback
===================

SmsFeedback simple SDK

1.1.0(7y ago)1132MITPHPPHP ^7.1CI failing

Since May 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/phpinfo/smsfeedback)[ Packagist](https://packagist.org/packages/phpinfo/smsfeedback)[ RSS](/packages/phpinfo-smsfeedback/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (3)Used By (2)

SmsFeedback SDK
===============

[](#smsfeedback-sdk)

This component allows you to simply work with [smsfeedback.ru](https://smsfeedback.ru) base API.

See service [API documentation](https://www.smsfeedback.ru/smsapi/) for more detailed information.

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

[](#installation)

```
composer require phpinfo/smsfeedback
```

Simple Usage
------------

[](#simple-usage)

The best way to instantiate API client is to use *ApiClientBuilder*:

```
$client = ApiClientFactory::createApiClient('login', 'password');

$client->send('71234567', 'Some SMS Text');
```

You can specify connection timeout (in msec) or API base URI:

```
$client = ApiClientFactory::createApiClient('login', 'password', 'https://service.mock', 3000);
```

Logging Requests
----------------

[](#logging-requests)

SDK builder supports [psr/logger](https://github.com/php-fig/log). [Monolog](https://github.com/Seldaek/monolog)usage example:

```
use Monolog\Handler\StreamHandler;
use Monolog\Logger;

$handler = new StreamHandler(STDOUT);
$logger  = new Logger('SmsFeedback', [$handler]);

$client = ApiClientFactory::createApiClient('login', 'password', null, null, $logger);
$client->balance();
```

Will output:

```
[2019-05-19 20:21:34] SmsFeedback.INFO: GET /messages/v2/balance HTTP/1.1 200 [] []
```

Symfony 4
---------

[](#symfony-4)

See [SmsFeedback Symfony Bundle](https://github.com/phpinfo/smsfeedback-bundle) for easy integration.

You can use `ApiClientFactory` in your DI container as well:

```
SmsFeedback\ApiClientInterface:
    factory: ['SmsFeedback\Factory\ApiClientFactory', 'createApiClient']
    arguments:
        $login: '%env(SMSFEEDBACK_LOGIN)%'
        $password: '%env(SMSFEEDBACK_PASSWORD)%'
```

Sending SMS
-----------

[](#sending-sms)

Simply sends SMS:

```
$message = $client->send('79161234567', 'SMS Text');
```

ArgumentTypeDescriptionExample**phone**stringPhone number79161234567**text**stringSMS TextSome SMS Textsender?stringSender short nameSENDERstatusQueueName?stringSMS status queue namemy-queuescheduleTime?stringScheduled time to send message (UTC only)2009-01-01T12:30:01+00:00Response object:

```
{
    "id": "A133541BC",
    "status": "accepted"
}
```

Retrieving SMS status
---------------------

[](#retrieving-sms-status)

```
$statuses = $client->status(['5169837636', '5169837647']);
```

```
[
    {
        "id": "5169837636",
        "status": "delivered"
    },
    {
        "id": "5169837647",
        "status": "delivery error"
    }
]
```

Retrieving balance
------------------

[](#retrieving-balance)

```
$balances = $client->balance();
```

```
[
    {
        "type": "RUB",
        "amount": 385.5,
        "credit": 0.0
    }
]
```

Retrieving senders
------------------

[](#retrieving-senders)

```
$senders = $client->senders();
```

```
[
    {
        "name": "SENDER",
        "status": "active",
        "comment": "Some sender comment"
    }
]
```

Manual control
--------------

[](#manual-control)

SDK uses [Guzzle 6](https://github.com/guzzle/guzzle) under the hood. You can specify Guzzle params directly:

```
$client = ApiClientBuilder::create('login', 'password')
    ->setHttpClientParams(
        [
            'base_uri' => 'https://my-domain.com',
            'timeout'  => 5.2,
        ]
    )
    ->getApiClient();
```

Note: Guzzle params will completely override timeout, base URI, logger and authorization features. You have to specify everything manually. In some cases it might be useful.

AuthorizationMiddleware
-----------------------

[](#authorizationmiddleware)

```
$stack = HandlerStack::create();

$stack->push(function (callable $handler) use ($login, $password) {
    return new AuthorizationMiddleware($handler, $login, $password);
});

$client = ApiClientBuilder::create()
    ->setHttpClientParams(
        [
            'base_uri' => 'http://api.smsfeedback.ru',
            'timeout'  => 5.0,
            'handler'  => $stack,
        ]
    )
    ->getApiClient();
```

Custom authorization middleware
-------------------------------

[](#custom-authorization-middleware)

```
$stack = HandlerStack::create();

$stack->push(function (callable $handler) use ($login, $password) {
    return function (RequestInterface $request, array $options) use ($handler, $login, $password) {
        $fn = $handler;

        $authHeader = sprintf('Basic %s', base64_encode($login . ':' . $password));
        $request = $request->withHeader('Authorization', $authHeader);

        return $fn($request, $options);
    };
});

$client = ApiClientBuilder::create()
    ->setHttpClientParams(
        [
            'base_uri' => 'http://api.smsfeedback.ru',
            'timeout'  => 5.0,
            'handler'  => $stack,
        ]
    )
    ->getApiClient();
```

Logger middleware
-----------------

[](#logger-middleware)

```
$stack = HandlerStack::create();

$logger    = new Logger('SmsFeedback', [$handler]);
$formatter = new MessageFormatter(MessageFormatter::SHORT);

$stack->push(Middleware::log($logger, $formatter));

$client = ApiClientBuilder::create()
    ->setHttpClientParams(
        [
            'base_uri' => 'http://api.smsfeedback.ru',
            'timeout'  => 5.0,
            'handler'  => $stack,
        ]
    )
    ->getApiClient();
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

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

Total

2

Last Release

2582d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/173149?v=4)[Alexey Gromov](/maintainers/phpinfo)[@phpinfo](https://github.com/phpinfo)

---

Top Contributors

[![phpinfo](https://avatars.githubusercontent.com/u/173149?v=4)](https://github.com/phpinfo "phpinfo (9 commits)")

---

Tags

sdksms

### Embed Badge

![Health badge](/badges/phpinfo-smsfeedback/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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