steein / steein-sdk
Steein SDK
2.0.7
2017-08-08 11:47 UTC
Requires
- php: ^5.6|^7.0
- guzzlehttp/guzzle: 6.2.3
- psr/log: 1.0.2
- steein/collections: 1.1.5
Requires (Dev)
- phpunit/phpunit: ~5.7.19
Suggests
- guzzlehttp/guzzle: Allows for implementation of the Guzzle HTTP client
- paragonie/random_compat: Provides a better CSPRNG option in PHP 5
This package is not auto-updated.
Last update: 2025-04-27 07:35:05 UTC
README
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:
require_once '/path/to/your-project/vendor/autoload.php';
SDK Documentation
Usage
Simple GET example of a user's account.
Version 1
sdk-config.ini
[Account] acct1.ClientId = {id} acct1.ClientSecret = {secret_key} acct1.VersionApi = v2.0
index.php
define('STEEIN_CONFIG_PATH', __DIR__); $steein = new Steein();
Version 2
$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.
License
Please see the license file for more information.