wrapit / php-sdk
This package is abandoned and no longer maintained.
No replacement package was suggested.
WrapIt SDK for PHP
0.1.4
2018-01-13 13:23 UTC
Requires
- php: ^5.4|^7.0
- curl/curl: ^1.5
Requires (Dev)
- mockery/mockery: ~0.8
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2022-02-01 13:09:13 UTC
README
Installation
The WrapIt SDK can be installed with Composer. Run this command:
composer require wrapit/php-sdk
Usage
Simple GET example to get data of a user profile
$wi = new \WrapIt\WrapIt([ 'domain' => '{domain}', 'client_id' => '{client-id}', 'client_secret' => '{client-secret}' ]); // Use the LoginHelper to get an AccessToken $userhelper = new \WrapIt\Helpers\WrapItUserHelper($wi, "{access-token}"); try { // Get data from the /people/me api $user = $userhelper->getUserData("me"); } catch (\WrapIt\Exceptions\WrapItResponseException $e) { echo 'The API returned an error: ' . $e->getMessage(); exit; } echo 'Logged in as ' . $user["name"];