PHPackages                             100yuristov/sto-yuristov-client - 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. 100yuristov/sto-yuristov-client

ActiveLibrary[API Development](/categories/api)

100yuristov/sto-yuristov-client
===============================

API client for 100yuristov.com service

v2.1.0(1w ago)092PHPPHP ^8.2CI passing

Since Jul 14Pushed 1w agoCompare

[ Source](https://github.com/Sunsetboy/StoYuristovClient)[ Packagist](https://packagist.org/packages/100yuristov/sto-yuristov-client)[ RSS](/packages/100yuristov-sto-yuristov-client/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (6)Versions (6)Used By (0)

Клиент для работы с API сервиса 100 Юристов
===========================================

[](#клиент-для-работы-с-api-сервиса-100-юристов)

Установка
---------

[](#установка)

```
composer require 100yuristov/sto-yuristov-client
```

Пакет не привязан к конкретной HTTP-библиотеке. Вам нужно установить любой PSR-18-совместимый HTTP-клиент. Например, Guzzle:

```
composer require guzzlehttp/guzzle php-http/guzzle7-adapter
```

Или Symfony HttpClient:

```
composer require symfony/http-client nyholm/psr7
```

---

Базовое использование
---------------------

[](#базовое-использование)

### С Guzzle

[](#с-guzzle)

```
use GuzzleHttp\Client as GuzzleClient;
use Http\Adapter\Guzzle7\Client as GuzzleAdapter;
use GuzzleHttp\Psr7\HttpFactory;
use StoYuristov\StoYuristovClient;
use StoYuristov\StoYuristovLead;

$adapter = GuzzleAdapter::createWithConfig(['timeout' => 5]);
$factory = new HttpFactory();

$client = new StoYuristovClient(
    appId: ВАШ_APP_ID,
    secretKey: 'ВАШ_СЕКРЕТНЫЙ_КЛЮЧ',
    httpClient: $adapter,
    requestFactory: $factory,
    streamFactory: $factory,
);
```

### С Symfony HttpClient

[](#с-symfony-httpclient)

```
use Symfony\Component\HttpClient\Psr18Client;
use StoYuristov\StoYuristovClient;

$psr18 = new Psr18Client();

$client = new StoYuristovClient(
    appId: ВАШ_APP_ID,
    secretKey: 'ВАШ_СЕКРЕТНЫЙ_КЛЮЧ',
    httpClient: $psr18,
    requestFactory: $psr18,
    streamFactory: $psr18,
);
```

---

Отправка лида
-------------

[](#отправка-лида)

```
use StoYuristov\StoYuristovLead;
use StoYuristov\Exception\ValidationException;
use StoYuristov\Exception\ApiException;

$lead = new StoYuristovLead(
    name: 'Иван Иванов',
    phone: '+79001234567',
    email: 'ivan@example.com',
    town: 'Москва',
    type: StoYuristovLead::TYPE_QUESTION,
    question: 'Как составить договор аренды?',
    price: 35, // опционально, если включён приём цены лида
);

try {
    $response = $client->sendLead($lead);
    echo $response->message; // описание ответа
    echo $response->leadId;  // ID созданного лида
} catch (ValidationException $e) {
    // Ошибки валидации на стороне клиента
    print_r($e->getErrors());
} catch (ApiException $e) {
    // Ошибка API или HTTP
    echo $e->getMessage();
    echo $e->getHttpStatusCode();
} catch (\Psr\Http\Client\ClientExceptionInterface $e) {
    // Ошибка транспорта (сеть недоступна и т.п.)
    echo $e->getMessage();
}
```

### Типы лида

[](#типы-лида)

КонстантаЗначениеОписание`StoYuristovLead::TYPE_QUESTION``1`Вопрос (по умолчанию)`StoYuristovLead::TYPE_CALL``2`Запрос обратного звонка---

Тестовый режим
--------------

[](#тестовый-режим)

В тестовом режиме лиды проверяются, но не сохраняются.

```
$client = new StoYuristovClient(
    appId: ВАШ_APP_ID,
    secretKey: 'ВАШ_СЕКРЕТНЫЙ_КЛЮЧ',
    httpClient: $httpClient,
    requestFactory: $requestFactory,
    streamFactory: $streamFactory,
    testMode: true,
);
```

Для тестирования против локального окружения можно передать кастомный `baseUrl`:

```
$client = new StoYuristovClient(
    appId: ВАШ_APP_ID,
    secretKey: 'ВАШ_СЕКРЕТНЫЙ_КЛЮЧ',
    httpClient: $httpClient,
    requestFactory: $requestFactory,
    streamFactory: $streamFactory,
    baseUrl: 'http://100yuristov.local/api/',
    testMode: true,
);
```

---

Повторные попытки и таймауты
----------------------------

[](#повторные-попытки-и-таймауты)

Библиотека не навязывает конкретный механизм ретраев — это задача HTTP-клиента. Пример с `php-http/retry-plugin`:

```
composer require php-http/httplug php-http/retry-plugin php-http/guzzle7-adapter
```

```
use Http\Client\Common\PluginClient;
use Http\Client\Common\Plugin\RetryPlugin;
use Http\Adapter\Guzzle7\Client as GuzzleAdapter;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Psr7\HttpFactory;

$guzzle  = new GuzzleClient(['timeout' => 5, 'connect_timeout' => 2]);
$adapter = new GuzzleAdapter($guzzle);
$factory = new HttpFactory();

$retryPlugin  = new RetryPlugin(['retries' => 3]);
$pluginClient = new PluginClient($adapter, [$retryPlugin]);

$client = new StoYuristovClient(
    appId: ВАШ_APP_ID,
    secretKey: 'ВАШ_СЕКРЕТНЫЙ_КЛЮЧ',
    httpClient: $pluginClient,
    requestFactory: $factory,
    streamFactory: $factory,
);
```

---

Подпись запроса
---------------

[](#подпись-запроса)

Подпись вычисляется автоматически перед каждой отправкой, указывать её вручную не нужно.

Запуск тестов локально
----------------------

[](#запуск-тестов-локально)

```
composer install
make test
```

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance98

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity74

Established project with proven stability

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

Total

4

Last Release

7d ago

Major Versions

v1.2 → v2.0.02026-03-11

PHP version history (3 changes)v1.1PHP ^5.3 || ^7.0

v1.2PHP ^5.3 || ^7.0 || ^8.0

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe40691354fc8874fcf7f3b4a12cc63f320073d928636f0a2b4828e8dbc12151?d=identicon)[100yuristov](/maintainers/100yuristov)

---

Top Contributors

[![Sunsetboy](https://avatars.githubusercontent.com/u/25583746?v=4)](https://github.com/Sunsetboy "Sunsetboy (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/100yuristov-sto-yuristov-client/health.svg)

```
[![Health](https://phpackages.com/badges/100yuristov-sto-yuristov-client/health.svg)](https://phpackages.com/packages/100yuristov-sto-yuristov-client)
```

###  Alternatives

[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60613.9M48](/packages/mollie-mollie-api-php)[kbsali/redmine-api

Redmine API client

4281.1M22](/packages/kbsali-redmine-api)[cmfcmf/openweathermap-php-api

A PHP API to parse weather data from OpenWeatherMap.org. This wrapper tries to normalise and abstract the data and remove inconsistencies.

3361.3M6](/packages/cmfcmf-openweathermap-php-api)[jane-php/jane-php

All jane libraries into one repository

678248.7k3](/packages/jane-php-jane-php)[norkunas/onesignal-php-api

OneSignal API for PHP

2361.7M17](/packages/norkunas-onesignal-php-api)[akeneo/api-php-client

Akeneo PIM client for the API

963.3M18](/packages/akeneo-api-php-client)

PHPackages © 2026

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