https://github.com/steeinru/steein-sdk-php
Steein SDK for PHP - client library.
https://github.com/steeinru/steein-sdk-php
php php7 rest-api sdk steein steein-php-sdk
Last synced: about 1 month ago
JSON representation
Steein SDK for PHP - client library.
- Host: GitHub
- URL: https://github.com/steeinru/steein-sdk-php
- Owner: SteeinRu
- License: apache-2.0
- Created: 2017-04-06T18:38:01.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-21T10:49:52.000Z (over 8 years ago)
- Last Synced: 2025-02-27T00:10:31.317Z (over 1 year ago)
- Topics: php, php7, rest-api, sdk, steein, steein-php-sdk
- Language: PHP
- Homepage: https://www.steein.ru/developers/docs/steein-api.overview
- Size: 109 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Steein SDK for PHP
***Welcome to Steein PHP SDK.*** This repository contains Steein's PHP SDK and samples for REST API.
## Installation
The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.
Once composer is installed, execute the following command in your project root to install this library:
```
composer require steein/steein-sdk
```
Finally, be sure to include the autoloader:
```php
require_once '/path/to/your-project/vendor/autoload.php';
```
## SDK Documentation
* [Documentation](https://www.steein.ru/developers/docs/steein-api.overview)
* [API Reference](https://www.steein.ru/developers/docs/api-reference.common-objects)
* [Samples](https://github.com/SteeinRu/steein-api-samples)
* [Installation](https://www.steein.ru/developers/docs/sdk-quickstart-guide.install)
* [Make your First SDK Call](https://www.steein.ru/developers/docs/steein-api.make-your-first-call)
## Usage
Simple GET example of a user's account.
### Version 1
***sdk-config.ini***
```ini
[Account]
acct1.ClientId = {id}
acct1.ClientSecret = {secret_key}
acct1.VersionApi = v2.0
```
***index.php***
```php
define('STEEIN_CONFIG_PATH', __DIR__);
$steein = new Steein();
```
### Version 2
```php
$steein = new Steein([
'client_id' => '{id}',
'client_secret' => '{secret_key}',
'default_api_version' => 'v2.0'
]);
$steein->setDefaultAccessToken('{access_token}');
$get = $steein->get('/users/show'); //$steein->get('/users/show',['id' => 1]);
$user = $get->getUserModel(); //$get->getDecodedBody()
echo 'ID: '. $user->getId(); //or $user->all();
```
Complete documentation, installation instructions, and examples are available [here](https://www.steein.ru/developers/docs/php/getting_started).
### License
Please see the [license file](https://github.com/SteeinRu/steein-sdk-php/blob/master/LICENSE) for more information.