websupport / api_php
Wrapper around cURL for simpler REST API communication
Installs: 4 939
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 10
Forks: 2
Open Issues: 1
Requires
- php: >=5.3
- lib-curl: *
This package is auto-updated.
Last update: 2024-12-25 21:11:58 UTC
README
Instalation using composer
Require composer package using terminal:
composer require websupport/api_php
Or add following to composer.json
file in your project:
{ "require" : { "websupport/api_php" : "~1.0" } }
And then run:
composer update
Note: Requires PHP version 5.3 or higher and the PHP cURL extension
Quick Start Example
$api = new \websupport\RestConnection('https://rest.websupport.sk/v1/', 'login', 'pass'); // load user info try { $userInfo = $api->get('user/self'); var_dump($userInfo); } catch (\websupport\RestException $e) { var_dump($e); // error via exception } // ordering domain try { $orderInfo = $api->post('user/self/order', array( "services"=>array( array('type'=>'domain', 'domain'=>'newdomain.com') ) )); var_dump($orderInfo); } catch (\websupport\RestException $e) { var_dump($e); // error via exception }
API Docs
More detailed documentation of all api methods can be found at our docs page.