macromindonline/vultr-api-client

PHP API client for api.vultr.com

1.1.2 2017-09-30 17:59 UTC

This package is not auto-updated.

Last update: 2024-11-13 05:52:54 UTC


README

Build Status Latest Stable Version Total Downloads Latest Unstable Version License SensioLabsInsight

Install using composer

Open a shell, cd to your poject and type:

composer require malc0mn/vultr-api-client

or edit composer.json and add:

{
    "require": {
        "malc0mn/vultr-api-client": "~1.0"
    }
}

If you want to use the GuzzleHttpAdapter, you will need to add Guzzle 5 or Guzzle 6.

Usage examples

Guzzle
require 'vendor/autoload.php';

use Vultr\VultrClient;
use Vultr\Adapter\GuzzleHttpAdapter;

// Using Guzzle 5 or 6...
$client = new VultrClient(
    new GuzzleHttpAdapter('your-api-key')
);

$result = $client->metaData()->getAccountInfo();

var_export($result);
CURL
require 'vendor/autoload.php';

use Vultr\VultrClient;
use Vultr\Adapter\CurlAdapter;

// Using regular CURL, courtesy of 'usefulz'
$client = new VultrClient(
    new CurlAdapter('your-api-key')
);

$result = $client->metaData()->getAccountInfo();

var_export($result);

Vultr API documentation

The full API documentation can be found on https://www.vultr.com/api and has been partly added to the PHP DocBlocks companioning the PHP functions that implement the actual calls.

Credits

The original version of this API is done by usefulz. This version has been forked by integr.io for use in one of our Symfony applications. It has been reworked with extensibility and ease of use in mind.