PHPackages                             imsadhappy/laravel-kyivstar-api - 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. imsadhappy/laravel-kyivstar-api

ActiveLibrary[API Development](/categories/api)

imsadhappy/laravel-kyivstar-api
===============================

Laravel package for Kyivstar API integration

0.2.0(1y ago)025MITPHPPHP ^7.4|^8.0

Since Sep 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/imsadhappy/laravel-kyivstar-api)[ Packagist](https://packagist.org/packages/imsadhappy/laravel-kyivstar-api)[ RSS](/packages/imsadhappy-laravel-kyivstar-api/feed)WikiDiscussions main Synced 1mo ago

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

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Latest Version on Packagist](https://camo.githubusercontent.com/b613f63e5524f9b5bf127299793085f9cc5c5cd2c4476b9892e86119e2203ccf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696d73616468617070792f6c61726176656c2d6b796976737461722d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imsadhappy/laravel-kyivstar-api)[![Total Downloads](https://camo.githubusercontent.com/c1220413d4cca3c5750c015cbb8d438d60953387c311c35b0422a61e229ba361/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696d73616468617070792f6c61726176656c2d6b796976737461722d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imsadhappy/laravel-kyivstar-api)

Laravel пакет для роботи з Київстар Open Telecom API
====================================================

[](#laravel-пакет-для-роботи-з-київстар-open-telecom-api)

Офіційна документація:
----------------------

[](#офіційна-документація)

Конфіг .env:
------------

[](#конфіг-env)

```
KYIVSTAR_API_CLIENT_ID="*Ваш Client ID"
KYIVSTAR_API_CLIENT_SECRET="*Ваш Client Secret"
KYIVSTAR_API_SERVER="mock (default), sandbox, або production"
KYIVSTAR_API_VERSION="Необов'язково, буде використана остання доступна"
KYIVSTAR_API_ALPHA_NAME="Необов'язково, можна передати параметром в сервіс"
```

Робота з SMS:
-------------

[](#робота-з-sms)

```
/**
 * Відправити SMS
 *
 * @param string $to - номер отримувача
 * @param string $text - повідомлення
 * @returns string $id - ідентифікатор відправленого SMS
 */
app(KyivstarApi::class)->Sms()->send('+380670000202', 'message text');
/**
 * Перевірити статус відправки SMS
 *
 * @param string $id - ідентифікатор відправленого SMS
 * @returns string $status - accepted|delivered|seen
 */
app(KyivstarApi::class)->Sms()->status($id);
```

Робота з Viber:
---------------

[](#робота-з-viber)

```
/**
 * Відправити Viber повідомелння
 *
 * @param string $to - номер отримувача
 * @param string $text - повідомлення
 * @returns string $id - ідентифікатор відправленого Viber повідомелння
 */
app(KyivstarApi::class)->Viber()->transaction('+380670000202', 'message text');

/**
 * Відправити Viber повідомелння з картинкою (і кнопкою)
 *
 * @param string $to - номер отримувача
 * @param string $text - повідомлення
 * @param int|null $messageTtlSec
 * @param string|null $img - посилання на зображення
 * @param string|null $caption - текст кнопки (необов'язково)
 * @param string|null $action - посилання кнопки (необов'язково)
 * @returns string $id - ідентифікатор відправленого Viber повідомелння
 */
app(KyivstarApi::class)->Viber()->promotion('+380670000202',
                                            'message text',
                                            null /* ttl, default 1209600 */,
                                            'https://example.com/image.jpg',
                                            'Click Me',
                                            'https://example.com/');

/**
 * Перевірити статус відправки Viber повідомелння
 *
 * @param string $id - ідентифікатор відправленого Viber повідомелння
 * @returns string $status - accepted|delivered|seen
 */
app(KyivstarApi::class)->Viber()->status($id);
```

Інше
----

[](#інше)

Alpha Name можна задати для всіх сервісів в .env або передавати в кожний сервіс окремо.

```
app(KyivstarApi::class)->Sms('Foo');
app(KyivstarApi::class)->Viber('Bar');
```

Виклик сервісів варто огортати в try ... catch блок. Можливі Config..., Value... і Http помилки (див. `src/Exceptions` і трейти типу `Validator` в `src/Traits`).

```
try {
    app(KyivstarApi::class)-> ...
} catch (\Exception $e) {
    ...
}
```

Перелік деяких можливих помилок:

```
ConfigException (with codes: 1-4)
ValueException:
    ValueIsEmptyException
    ValueIsNotAllowedException
    ValueNotBetweenException
    ValueNotUrlException
    ValueTooLongException
    ValueTooShortException
AuthenticationException
NotFoundHttpException
UnprocessableEntityHttpException
RequestException

```

Changelog
---------

[](#changelog)

### Version 0.2.1

[](#version-021)

- added MessengerInterface implemented by SmsService &amp; ViberService
- minor tests refactoring

### Version 0.2.0

[](#version-020)

- beta release - added tests

#### Version 0.1.9

[](#version-019)

- fix message (sms, transaction) segmentation

#### Version 0.1.8

[](#version-018)

- updated readme
- made api &amp; services final
- added MAX\_TTL to Sms &amp; Transaction DTOs
- changed VersionedTestCase to set up authentication facade

#### Version 0.1.7

[](#version-017)

- added VersionedTestCase for version-aware tests (now used in AuthenticationServiceTest, SmsServiceTest &amp; ViberServiceTest)

#### Version 0.1.6

[](#version-016)

- added SEGMENT\_SIZE &amp; MAX\_SEGMENT\_COUNT to Sms DTO.
- added TTL to AuthenticationService
- fix: ViberService response receives 'mid' not 'msgId' param
- moved SmsTest &amp; ViberPromotionTest to feature
- made AuthenticationServiceTest version-aware (v1beta)
- added feature tests: SmsServiceTest &amp; ViberServiceTest (v1beta)

#### Version 0.1.5

[](#version-015)

- added feature tests: AuthenticationServiceTest
- refactoring: TestCase, ConfigValidatorTest, HasAlphaNameTest, HttpValidatorTest
- made JsonHttpService &amp; AuthenticationService future-proof in case of endpoint changes

#### Version 0.1.4

[](#version-014)

- added 404 NotFoundHttpException to HttpValidator and respective test (+ minor refactoring of test)

#### Version 0.1.3

[](#version-013)

- added unit tests (for DTOs &amp; traits): ConfigValidatorTest, HasAlphaNameTest, HttpValidatorTest, ObjectToArrayTest, ValueValidatorTest, SmsTest, ViberPromotionTest
- added supportedVersions list &amp; exception codes to ConfigValidator trait

#### Version 0.1.2

[](#version-012)

- refactoring: AuthenticationService

#### Version 0.1.1

[](#version-011)

- refactoring: exposed get|post|put in JsonHttpService instead of try

#### Version 0.1.0

[](#version-010)

- alpha release

#### Version 0.0.4

[](#version-004)

- new traits: HttpValidator (for JsonHttpService &amp; AuthenticationService) &amp; ConfigValidator
- moved isValidConfig from ValueValidator to ConfigValidator
- removed excessive use declarations

#### Version 0.0.3

[](#version-003)

- added traits: ObjectToArray (for Message &amp; Viber/ContentExtended DTOs)
- minor refactoring

#### Version 0.0.2

[](#version-002)

- AuthenticationService nolonger extends HttpService
- DTOs props array removed in favor of direct properties
- added config validation
- new method: ValueValidator:isValidConfig
- new exceptions: ConfigException, ValueIsNotAllowedException
- renamed: HttpService -&gt; JsonHttpService, config.php -&gt; kyivstar-api.php
- removed: PropsIterator

#### Version 0.0.1

[](#version-001)

- initial commit: Facade, ServiceProvider
- new services: HttpService, AuthenticationService, SmsService, ViberService
- new traits: HasAlphaName, PropsIterator, ValueValidator
- new DTOs: Message, Sms, Viber/Transaction, Viber/Promotion, Viber/ContentExtended
- new exceptions: ValueException, ValueIsEmptyException, ValueNotUrlException, ValueTooLongException, ValueTooShortException, ValueNotBetweenException

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

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

Total

2

Last Release

581d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b114d82e8dcb872e611fc1b1b5daf92cf2a1bb9a212fcd8861a6b65ccb2afcf?d=identicon)[imsadhappy](/maintainers/imsadhappy)

---

Top Contributors

[![imsadhappy](https://avatars.githubusercontent.com/u/3319423?v=4)](https://github.com/imsadhappy "imsadhappy (18 commits)")

---

Tags

kyivstarlaravel-packagesmskyivstar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/imsadhappy-laravel-kyivstar-api/health.svg)

```
[![Health](https://phpackages.com/badges/imsadhappy-laravel-kyivstar-api/health.svg)](https://phpackages.com/packages/imsadhappy-laravel-kyivstar-api)
```

###  Alternatives

[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)

PHPackages © 2026

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