2017 © Pedro Peláez
 

library api_php

Wrapper around cURL for simpler REST API communication

image

websupport/api_php

Wrapper around cURL for simpler REST API communication

  • Saturday, February 28, 2015
  • by freezy
  • Repository
  • 10 Watchers
  • 3 Stars
  • 4,399 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

Instalation using composer

Require composer package using terminal:, (*1)

composer require websupport/api_php

Or add following to composer.json file in your project:, (*2)

{
    "require" : {
        "websupport/api_php" : "~1.0"
    }
}

And then run:, (*3)

composer update

Note: Requires PHP version 5.3 or higher and the PHP cURL extension, (*4)

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., (*5)

The Versions

28/02 2015

dev-master

9999999-dev https://github.com/websupport-sk/api_php

Wrapper around cURL for simpler REST API communication

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3
  • lib-curl *

 

by Matej Capkovic

28/02 2015

v1.0.0

1.0.0.0 https://github.com/websupport-sk/api_php

Wrapper around cURL for simpler REST API communication

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3
  • lib-curl *

 

by Matej Capkovic