PHPackages                             upmind/hexonet-php-sdk - 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. upmind/hexonet-php-sdk

ActiveLibrary[API Development](/categories/api)

upmind/hexonet-php-sdk
======================

API connector library for the insanely fast HEXONET backend API

v5.8.7(1y ago)0404↓50%MITHTMLPHP &gt;=5.6.0

Since Mar 27Pushed 1y ago3 watchersCompare

[ Source](https://github.com/upmind/hexonet-php-sdk)[ Packagist](https://packagist.org/packages/upmind/hexonet-php-sdk)[ Docs](https://github.com/hexonet/php-sdk)[ RSS](/packages/upmind-hexonet-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

php-sdk
=======

[](#php-sdk)

[![semantic-release](https://camo.githubusercontent.com/5f3b57745af83409bc673dec57e3eb360e1ec53b37ac29f81a319e347fa351c6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2532302532302546302539462539332541362546302539462539412538302d73656d616e7469632d2d72656c656173652d6531303037392e737667)](https://github.com/semantic-release/semantic-release)[![Build Status](https://camo.githubusercontent.com/f26406829dd591ab539a8f5e74a8ba7a91ce75066b0058c6962bbc1734832227/68747470733a2f2f7472617669732d63692e636f6d2f6865786f6e65742f7068702d73646b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/hexonet/php-sdk)[![Packagist](https://camo.githubusercontent.com/c1d681d7353dff47043259cd92fd72fda4541282cbce4692ea2e228f3ceea0e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6865786f6e65742f7068702d73646b2e737667)](https://packagist.org/packages/hexonet/php-sdk)[![PHP from Packagist](https://camo.githubusercontent.com/cf73b2a6321d228666fd553fe20b0762a2d7ec578cf2548dd20c5161344e3f51/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6865786f6e65742f7068702d73646b2e737667)](https://packagist.org/packages/hexonet/php-sdk)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT)[![PRs welcome](https://camo.githubusercontent.com/dd0b24c1e6776719edb2c273548a510d6490d8d25269a043dfabbd38419905da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e737667)](https://github.com/hexonet/php-sdk/blob/master/CONTRIBUTING.md)

This module is a connector library for the insanely fast HEXONET Backend API. For further informations visit our [homepage](http://hexonet.net) and do not hesitate to [contact us](https://www.hexonet.net/contact).

Resources
---------

[](#resources)

- [Usage Guide](https://github.com/hexonet/php-sdk/blob/master/README.md#how-to-use-this-module-in-your-project)
- [Migration Guide](https://github.com/hexonet/php-sdk/wiki/Migration-Guide)
- [SDK Documenation](https://rawgit.com/hexonet/php-sdk/master/build/api/index.html)
- [HEXONET Backend API Documentation](https://github.com/hexonet/hexonet-api-documentation/tree/master/API)
- [Release Notes](https://github.com/hexonet/php-sdk/releases)
- [Development Guide](https://github.com/hexonet/php-sdk/wiki/Development-Guide)

Features
--------

[](#features)

- Automatic IDN conversion to punycode (our API accepts only punycode format in commands)
- Allows nested associative arrays in API commands to improve for bulk parameters
- Connecting and communication with our API
- Possibility to use a custom mechanism for debug mode
- Several ways to access and deal with response data
- Getting the command again returned together with the response
- Sessionless communication
- Session based communication
- Possibility to save API session identifier in session
- Configure a Proxy for API communication
- Configure a Referer for API communication
- High Performance Proxy Setup

How to use this module in your project
--------------------------------------

[](#how-to-use-this-module-in-your-project)

We have also a demo app available showing how to integrate and use our SDK. See [here](https://github.com/hexonet/php-sdk-demo).

### Requirements

[](#requirements)

- Installed php (&gt;= v5.6.0) and php-curl
- Installed [composer](https://getcomposer.org/download/).

### Download from packagist

[](#download-from-packagist)

This module is available on the [PHP Package Registry](https://packagist.org/packages/hexonet/php-sdk).

Run `composer require "hexonet/php-sdk:*"` to get the latest version downloaded and added to composer.json. In your script simply use `require 'vendor/autoload.php';` or `require 'vendor/hexonet/php-sdk';`

NOTE: The above will also set `"hexonet/php-sdk": "*"` as dependency entry in your composer.json. When running `composer install` this would always install the latest release version. This is dangerous for production systems as major version upgrades may come with breaking changes and are then incompatible with your app. For production systems we suggest to use a version dependent syntax, e.g. `composer require "hexonet/php-sdk:v3.0.3"`. You can find the versions listed at packagist or at github in the release / tag overview.

#### Alternatives

[](#alternatives)

Of course you could also using composer to install it from github or using the PHAR archives we offer for download in release overview, but the previous approach is the one we suggest. When using the .phar archive, please ensure to have the phar extension for PHP installed and loaded: `php-phar`

### High Performance Proxy Setup

[](#high-performance-proxy-setup)

Long distances to our main data center in Germany may result in high network latencies. If you encounter such problems, we highly recommend to use this setup, as it uses persistent connections to our API server and the overhead for connection establishments is omitted.

#### Step 1: Required Apache2 packages / modules

[](#step-1-required-apache2-packages--modules)

*At least Apache version 2.2.9* is required.

The following Apache2 modules must be installed and activated:

```
proxy.conf
proxy.load
proxy_http.load
ssl.conf # for HTTPs connection to our API server
ssl.load # for HTTPs connection to our API server
```

#### Step 2: Apache configuration

[](#step-2-apache-configuration)

An example Apache configuration with binding to localhost:

```

    ServerAdmin webmaster@localhost

    ServerSignature Off

    SSLProxyEngine on
    ProxyPass /api/call.cgi https://api.ispapi.net/api/call.cgi min=1 max=2

        Order Deny,Allow
        Deny from none
        Allow from all

```

After saving your configuration changes please restart the Apache webserver.

#### Step 3: Using this setup

[](#step-3-using-this-setup)

```
$cl = new \HEXONET\APIClient();
$cl->useOTESystem()//LIVE System would be used otherwise by default
   ->useHighPerformanceConnectionSetup()//Default Connection Setup would be used otherwise by default
   ->setCredentials("test.user", "test.passw0rd");
$r = $cl->request(["COMMAND" => "StatusAccount"]);
```

So, what happens in code behind the scenes? We communicate with localhost (so our proxy setup) that passes the requests to the HEXONET API. Of course we can't activate this setup by default as it is based on Steps 1 and 2. Otherwise connecting to our API wouldn't work.

Just in case the above port or ip address can't be used, use function setURL instead to set a different URL / Port. `http://127.0.0.1/api/call.cgi` is the default URL for the High Performance Proxy Setup. e.g. `$cl->setURL("http://127.0.0.1:8765/api/call.cgi");` would change the port. Configure that port also in the Apache Configuration (-&gt; Step 2)!

Don't use `https` for that setup as it leads to slowing things down as of the https `overhead` of securing the connection. In this setup we just connect to localhost, so no direct outgoing network traffic using `http`. The apache configuration finally takes care passing it to `https` for the final communication to the HEXONET API.

### Customize Logging / Outputs

[](#customize-logging--outputs)

When having the debug mode activated \\HEXONET\\Logger will be used for doing outputs. Of course it could be of interest for integrators to look for a way of getting this replaced by a custom mechanism like forwarding things to a 3rd-party software, logging into file or whatever.

```
$cl = new \HEXONET\APIClient();
$cl->useOTESystem()//LIVE System would be used otherwise by default
   ->enableDebugMode()//activate debug outputs
   ->setCustomLogger(new MyCustomerLogger())//provide your mechanism here
   ->setCredentials("test.user", "test.passw0rd");
$r = $cl->request(["COMMAND" => "StatusAccount"]);
```

NOTE: Find an example for a custom logger class implementation in `src/CustomLogger.php`. If you have questions, feel free to open a github issue.

### Usage Examples

[](#usage-examples)

Please have an eye on our [HEXONET Backend API documentation](https://github.com/hexonet/hexonet-api-documentation/tree/master/API). Here you can find information on available Commands and their response data.

#### Session based API Communication

[](#session-based-api-communication)

Available since version 4.x!

```
$cl = new \HEXONET\APIClient();
$cl->useOTESystem()//LIVE System would be used otherwise by default
   ->setCredentials("test.user", "test.passw0rd");
$r = $cl->login();
// or this line for using 2FA
// $r = $cl->login('.. here your otp code ...');
if ($r->isSuccess()){
    echo "LOGIN SUCCEEDED.";

    // Now reuse the created API session for further request
    // You don't have to care about anything!
    $r = $cl->request(array(
        "COMMAND" => "StatusAccount"
    ));
    echo "" . htmlspecialchars(print_r($r->getHash(), true)) . "";

    // Perform session close and logout
    $r = $cl->logout();
    if ($r->isSuccess()){
        echo "LOGOUT SUCCEEDED.";
    } else {
        echo "LOGOUT FAILED.";
    }
}
else {
    echo "LOGIN FAILED.";
}
```

##### Save session config into PHP Session

[](#save-session-config-into-php-session)

If you're realizing your own frontend on top, you need a solution to keep the Backend API Session that the PHP-SDK wraps internally to be reusable in further page loads. This can be achieved by

```
// right after successful login
$cl->saveSession($_SESSION);
```

and

```
// for every further request
$cl->reuseSession($_SESSION);
```

#### Sessionless API Communication

[](#sessionless-api-communication)

```
require __DIR__ . '/vendor/autoload.php';

// --- SESSIONLESS API COMMUNICATION ---
$cl = new \HEXONET\APIClient();
$cl->useOTESystem()//LIVE System would be used otherwise by default
   // ->setRemoteIPAddress("1.2.3.4:80"); // provide ip address used for active ip filter
   ->setCredentials("test.user", "test.passw0rd");
$r = $cl->request(array(
    "COMMAND" => "StatusAccount"
));
echo "" . htmlspecialchars(print_r($r->getHash(), true)) . "";
```

#### Using array-based notation for bulk parameters in command \[SINCE 5.2.0\]

[](#using-array-based-notation-for-bulk-parameters-in-command-since-520)

Use the below to improve code a bit:

```
require __DIR__ . '/vendor/autoload.php';

$cl = new \HEXONET\APIClient();
$cl->useOTESystem()
   ->setCredentials("test.user", "test.passw0rd");
$r = $cl->request([
    "COMMAND" => "QueryDomainOptions"
    "DOMAIN" => ["example1.com", "example2.com"]
]);
echo "" . htmlspecialchars(print_r($r->getHash(), true)) . "";
```

instead of:

```
require __DIR__ . '/vendor/autoload.php';

$cl = new \HEXONET\APIClient();
$cl->useOTESystem()
   ->setCredentials("test.user", "test.passw0rd");
$r = $cl->request([
    "COMMAND" => "QueryDomainOptions"
    "DOMAIN0" => "example1.com",
    "DOMAIN1" => "example2.com"
]);
echo "" . htmlspecialchars(print_r($r->getHash(), true)) . "";
```

#### FYI

[](#fyi)

`$cl` - the APIClient Object - and `$r` - the Response Object - provide further useful Methods to access configure the connection and to access response data. Have an eye on the [class documentation](https://rawgit.com/hexonet/php-sdk/master/build/api/index.html).

Contributing
------------

[](#contributing)

Please read [our development guide](https://github.com/hexonet/php-sdk/wiki/Development-Guide) for details on our code of conduct, and the process for submitting pull requests to us.

Authors
-------

[](#authors)

- **Anthony Schneider** - *development* - [AnthonySchn](https://github.com/anthonyschn)
- **Kai Schwarz** - *development* - [PapaKai](https://github.com/papakai)

See also the list of [contributors](https://github.com/hexonet/php-sdk/graphs/contributors) who participated in this project.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance46

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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 ~0 days

Total

2

Last Release

417d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cff84f90ef00830deef6ed09c1cffb47ec1ea1d2f2b7e97cc5caf39c898c79e6?d=identicon)[uphlewis](/maintainers/uphlewis)

---

Top Contributors

[![james-at-upmind](https://avatars.githubusercontent.com/u/228694717?v=4)](https://github.com/james-at-upmind "james-at-upmind (1 commits)")[![uphlewis](https://avatars.githubusercontent.com/u/43346009?v=4)](https://github.com/uphlewis "uphlewis (1 commits)")

---

Tags

apisdkdnssslconnectorapplicationregistrationdomainispcertpremiumbackorderpreregistrationhexonetispapi

### Embed Badge

![Health badge](/badges/upmind-hexonet-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/upmind-hexonet-php-sdk/health.svg)](https://phpackages.com/packages/upmind-hexonet-php-sdk)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[corbanb/freebird-php

Twitter API v1.1 Application only authoization library

148.6k](/packages/corbanb-freebird-php)

PHPackages © 2026

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