nighten/api-client

Nighten API client

0.1 2020-01-16 12:33 UTC

This package is auto-updated.

Last update: 2024-03-20 21:52:54 UTC


README

Latest Stable Version Build Status Scrutinizer Code Quality Code Coverage License

Описание

Библиотека для взаимодействия с API

Установка

composer require nighten/api-client

Пример

Создание клиента

$client = new \Nighten\ApiClient\Client($host);

Аунтификация в API

$response = $client->request(new AuthRequest($login, $password)); //return \Nighten\ApiClient\Response\Auth\AuthResponse;
$response->getUserId(); //Уникальный идентификатор пользователя
$response->getKey(); //Api ключ, для аунтификации в запросах требующих ключ.

Запросы требующие ключ

$client->setAuthenticationProvider(new DefaultAuthenticationProvider('api-key'));
$response = $client->request(...);

Лицензия

This project is licensed under the MIT License - see the LICENSE.md file for details