This is not the official library!
This is a minor rewrite of original api library using Guzzle client and strict typing.
- PHP 7.4+
Require the package via Composer:
composer require newman/draugiem-php-sdk
Response is an implementation of Psr\Http\Message\ResponseInterface
.
$draugiemApi = new \Newman\DraugiemPhpSdk\DraugiemApi(1234, 'app key');
//$draugiemApi = new \Newman\DraugiemPhpSdk\DraugiemApi(1234, 'app key', 'user key');
$response = $draugiemApi->apiCall('authorize', ['code' => 5728195]);
var_dump($response->getStatusCode());
var_dump($response->getBody()->getContents());
$draugiemApi = new \Newman\DraugiemPhpSdk\DraugiemApi(1234, 'app key');
$draugiemApi->setDefaultGuzzleClientOptions([
'timeout' => 10,
'headers' => [
'User-Agent' => 'testing/1.0',
],
]);
// make an api call
We'll appreciate your collaboration to this package.
When making pull requests, make sure:
- All tests are passing:
composer test
- Test coverage is not reduced:
composer test-coverage
- There are no PHPStan errors:
composer phpstan
- Coding standard is followed:
composer lint
orcomposer fix-style
to automatically fix it.