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

ActiveLibrary[API Development](/categories/api)

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

API client for 100 Yuristov Core service

03↓81.8%PHPCI passing

Since Apr 4Pushed 2mo agoCompare

[ Source](https://github.com/Sunsetboy/sto-core-php-client)[ Packagist](https://packagist.org/packages/100yuristov/sto-core-client)[ RSS](/packages/100yuristov-sto-core-client/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

100 Юристов Core — PHP SDK
==========================

[](#100-юристов-core--php-sdk)

PHP-клиент для интеграции сайтов с ядром сети 100 Юристов.

Требования
----------

[](#требования)

- PHP 8.2+
- PSR-18 HTTP-клиент (например, Guzzle или Symfony HTTP Client)
- PSR-17 фабрики запросов и потоков

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

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

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

Инициализация
-------------

[](#инициализация)

Для работы с SDK необходимы `api_key` и `api_secret` сайта, которые выдаёт администратор ядра.

SDK не привязан к конкретному HTTP-клиенту — передайте любой PSR-18 совместимый:

**Guzzle:**

```
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Psr7\HttpFactory;
use StoCore\StoClient;

$httpClient = new GuzzleClient();
$factory    = new HttpFactory();

$client = new StoClient(
    apiKey:         'ваш_api_key',
    apiSecret:      'ваш_api_secret',
    httpClient:     $httpClient,
    requestFactory: $factory,
    streamFactory:  $factory,
);
```

**Symfony HTTP Client:**

```
use Symfony\Component\HttpClient\Psr18Client;
use StoCore\StoClient;

$httpClient = new Psr18Client();

$client = new StoClient(
    apiKey:         'ваш_api_key',
    apiSecret:      'ваш_api_secret',
    httpClient:     $httpClient,
    requestFactory: $httpClient,
    streamFactory:  $httpClient,
);
```

По умолчанию клиент обращается к `https://core.100yuristov.com`. Чтобы изменить адрес, передайте параметр `baseUrl`:

```
$client = new StoClient(
    apiKey:         'ваш_api_key',
    apiSecret:      'ваш_api_secret',
    httpClient:     $httpClient,
    requestFactory: $factory,
    streamFactory:  $factory,
    baseUrl:        'https://staging.core.100yuristov.com',
);
```

Создание вопроса
----------------

[](#создание-вопроса)

```
use StoCore\CreateQuestionRequest;
use StoCore\Exception\ApiException;

$request = new CreateQuestionRequest(
    externalId: '123',           // ID вопроса на вашем сайте
    text:       'Текст вопроса',
    authorName: 'Иван',
    price:      1000,            // в копейках
    currency:   'RUB',
);

try {
    $question = $client->createQuestion($request);

    echo $question->id;         // ID вопроса в ядре
    echo $question->externalId; // ваш исходный ID
    echo $question->createdAt;  // дата создания
} catch (ApiException $e) {
    echo $e->getMessage();          // текст ошибки от API
    echo $e->getHttpStatusCode();   // HTTP статус
}
```

### Параметры CreateQuestionRequest

[](#параметры-createquestionrequest)

ПараметрТипОбязательныйОписание`externalId`stringдаID вопроса на вашем сайте`text`stringдаТекст вопроса`authorName`stringнетИмя автора`price`intнетЦена в копейках (по умолчанию 0)`currency`stringнетВалюта (по умолчанию `RUB`)Обновление вопроса
------------------

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

```
use StoCore\UpdateQuestionRequest;
use StoCore\Exception\ApiException;

$request = new UpdateQuestionRequest(
    text:       'Обновлённый текст вопроса',
    authorName: 'Иван',
    price:      2000,   // в копейках
    currency:   'RUB',
);

try {
    $question = $client->updateQuestion('123', $request);

    echo $question->id;   // ID вопроса в ядре
    echo $question->text; // обновлённый текст
} catch (ApiException $e) {
    echo $e->getMessage();        // текст ошибки от API
    echo $e->getHttpStatusCode(); // HTTP статус
}
```

Первый аргумент `updateQuestion()` — `external_id` вопроса на вашем сайте (тот же, что передавался при создании).

### Параметры UpdateQuestionRequest

[](#параметры-updatequestionrequest)

ПараметрТипОбязательныйОписание`text`stringдаТекст вопроса`authorName`stringнетИмя автора`price`intнетЦена в копейках (по умолчанию 0)`currency`stringнетВалюта (по умолчанию `RUB`)Обработка ошибок
----------------

[](#обработка-ошибок)

Все ошибки API выбрасывают `StoCore\Exception\ApiException`:

HTTP статусПричина401Неверный `api_key` или подпись404Вопрос с таким `external_id` не найден (только для `updateQuestion`)409Вопрос с таким `external_id` уже существует (только для `createQuestion`)500Внутренняя ошибка ядра

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance56

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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.

### 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 (2 commits)")

### Embed Badge

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

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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