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. phpinfo/smsfeedback

ActiveLibrary

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

SmsFeedback simple SDK

1.1.0(6y ago)1132MITPHPPHP ^7.1

Since May 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/phpinfo/smsfeedback)[ Packagist](https://packagist.org/packages/phpinfo/smsfeedback)[ RSS](/packages/phpinfo-smsfeedback/feed)WikiDiscussions master Synced 3d 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

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

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

2533d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/14e9dedbe3c0132ecddaeee1af170b0ad9111278850cd0e7f5691b347f7b7160?d=identicon)[phpinfo](/maintainers/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.3k511.3M2.2k](/packages/aws-aws-sdk-php)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M468](/packages/saloonphp-saloon)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client

Documentation for all of Ory Hydra's APIs.

17435.9k](/packages/ory-hydra-client)

PHPackages © 2026

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