Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

nekofar/nobitex-api-php-client

Repository files navigation

Nobitex Market PHP API

Packagist Version PHP from Packagist Tests Status Coverage Status License Twitter: nekofar

This is a PHP wrapper for the Nobitex API.

Installation

This wrapper relies on HTTPlug, which defines how HTTP message should be sent and received. You can use any library to send HTTP messages that implements php-http/client-implementation.

composer require nekofar/nobitex:^2.0

To install with cURL you may run the following command:

composer require nekofar/nobitex:^2.0 php-http/curl-client:^2.0

Usage

Use your username and password to access your own account.

use \Nekofar\Nobitex\Client;
use \Nekofar\Nobitex\Config;

$config = Config::doAuth('username', 'password')
$client = Client::create($config)

try {
    $profile = $client->getUserProfile();

    echo 'Email: ' . $profile->email . PHP_EOL;
    echo 'Last name: ' . $profile->lastName . PHP_EOL;
    echo 'First name: ' . $profile->firstName . PHP_EOL;

} catche (\Exception $e) {
    echo 'Error: ' . $e->getMessage();
}

Contributing

The test suite is built using PHPUnit. Run the suite of unit tests by running the phpunit command or this composer script.

composer test

License

The MIT License (MIT). Please see License File for more information.