exavault/evapi-php-guzzle-compat

This package is abandoned and no longer maintained. No replacement package was suggested.

PHP Guzzle6 Compatibility SDK for ExaVault API

v2.1.6 2021-11-30 20:17 UTC

This package is auto-updated.

Last update: 2024-07-29 05:47:04 UTC


README

Introduction

Welcome to ExaVault's PHP code library for our v2 API. Our v2 API will allow you to interact with all aspects of the service the same way our web portal would. The library is generated from our API's public swagger YAML file.

Important Note About Guzzle

This library should be used when your project requires a different version of guzzle than version 6. We have updated references to the Guzzle library to use version 6.5.5, which has been included in the vendor-static subdirectory. If your project does not require a different version of Guzzle, use our normal PHP library instead.

Requirements

To use this library, you'll need PHP 5.5 (or greater) installed as well as composer.

You will also need an ExaVault account, as well as an API key and access token.

Installing the Code Library

Option 1 - Using Composer

You can use composer to add this library to your project by running this command in your project folder:

% composer require exavault/evapi-php-guzzle-compat 

Option 2 - Manual Installation

Alternatively, you can clone the github repo and then run composer install in the evapi-php-guzzle-compat directory to install dependencies.

Sample Code

For a gentle introduction to using PHP code with ExaVault's API, check out our code samples. Follow the instructions in that repository's README to run the sample scripts, which will demonstrate how to use several of the generated PHP classes to interact with your ExaVault account.

Writing Your Own Code

When you're ready to write your own code using this library, you'll need to:

  1. Install our code library in your project, either with composer require exavault/evapi-php-guzzle-compat or by downloading this repository and running composer install
  2. Include the generated vendor/autoload.php to the top of your script
  3. Provide your API key and access token with every function method on the Api classes, which are in the ExaVault\Api namespace.
  4. Whenever you instantiate an Api object (ResourcesApi, UsersApi, etc.), override the configuration to point the code at the correct API URL:
// Replace YOUR_ACCOUNT_NAME_HERE with your account name!
$account_url = "https://YOUR_ACCOUNT_NAME_HERE.exavault.com/api/v2/";
$accountApi = new ExaVault\Api\AccountApi(
    null,
    (new ExaVault\Configuration())->setHost($account_url)
);
$resourcesApi = new ExaVault\Api\ResourcesApi(
    null,
    (new ExaVault\Configuration())->setHost($account_url)
);
$usersApi = new ExaVault\Api\UsersApi(
    null,
    (new ExaVault\Configuration())->setHost($account_url)
);

If you'd like to see this done in sample code, please take a look at our code samples.

Author

support@exavault.com