PHP API client for api.vultr.com

PHP API client for api.vultr.com

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 VultrVultrClient;
use VultrAdapterGuzzleHttpAdapter;

// 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 VultrVultrClient;
use VultrAdapterCurlAdapter;

// 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.

Source

Add a Comment

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *