|
| 1 | +## Resources |
| 2 | + |
| 3 | +* [Usage Guide](https://github.com/hexonet/php-sdk/blob/master/README.md#how-to-use-this-module-in-your-project) |
| 4 | +* [SDK Documenation](https://rawgit.com/hexonet/php-sdk/master/build/api/index.html) |
| 5 | +* [HEXONET Backend API Documentation](https://github.com/hexonet/hexonet-api-documentation/tree/master/API) |
| 6 | +* [Release Notes](https://github.com/hexonet/php-sdk/releases) |
| 7 | +* [Development Guide](https://github.com/hexonet/php-sdk/wiki/Development-Guide) |
| 8 | + |
| 9 | +## How to use this module in your project |
| 10 | + |
| 11 | +We have also a demo app available showing how to integrate and use our SDK. See [here](https://github.com/hexonet/php-sdk-demo). |
| 12 | + |
| 13 | +### Requirements |
| 14 | + |
| 15 | +* Installed php and php-curl |
| 16 | +* Installed [composer](https://getcomposer.org/download/). |
| 17 | + |
| 18 | +### Download from packagist |
| 19 | + |
| 20 | +This module is available on the [PHP Package Registry](https://packagist.org/packages/hexonet/php-sdk). |
| 21 | + |
| 22 | +Run `composer require "hexonet/php-sdk:*"` to get the latest version downloaded and added to composer.json. |
| 23 | +In your script simply use `require 'vendor/autoload.php';` or `require 'vendor/hexonet/php-sdk';` |
| 24 | + |
| 25 | +NOTE: The above will also set `"hexont/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"`. |
| 26 | +You can find the versions listed at packagist or at github in the release / tag overview. |
| 27 | + |
| 28 | +### Usage Examples |
| 29 | + |
| 30 | +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. |
| 31 | + |
| 32 | +#### Session based API Communication |
| 33 | + |
| 34 | +Not yet available, this needs a review of the SDK. |
| 35 | + |
| 36 | +#### Sessionless API Communication |
| 37 | + |
| 38 | +```php |
| 39 | +require __DIR__ . '/vendor/autoload.php'; |
| 40 | + |
| 41 | +// --- SESSIONLESS API COMMUNICATION --- |
| 42 | +$api = \HEXONET\Connection::connect(array( |
| 43 | + "url" => "https://coreapi.1api.net/api/call.cgi", |
| 44 | + "login" => "test.user", |
| 45 | + "password" => "test.passw0rd", |
| 46 | + "entity" => "1234", |
| 47 | + //"remoteaddr" => "1.2.3.4" //optional: use this in case of ip filter setting |
| 48 | +)); |
| 49 | + |
| 50 | +$r = $api->call(array( |
| 51 | + "COMMAND" => "StatusAccount" |
| 52 | +)); |
| 53 | +echo "<pre>" . htmlspecialchars(print_r($r->asHash(), true)) . "</pre>"; |
| 54 | +``` |
| 55 | + |
| 56 | +## Contributing |
| 57 | + |
| 58 | +Please read [our development guide](https://github.com/hexonet/java-sdk/wiki/Development-Guide) for details on our code of conduct, and the process for submitting pull requests to us. |
| 59 | + |
| 60 | +## Authors |
| 61 | + |
| 62 | +* **Anthony Schneider** - *development* - [ISharky](https://github.com/isharky) |
| 63 | +* **Kai Schwarz** - *development* - [PapaKai](https://github.com/papakai) |
| 64 | + |
| 65 | +See also the list of [contributors](https://github.com/hexonet/php-sdk/graphs/contributors) who participated in this project. |
| 66 | + |
| 67 | +## License |
| 68 | + |
| 69 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
0 commit comments