PHP

The Comfortable PHP SDK can be installed with Composer. Run this command:

composer require comfortable/php-sdk

Usage

Note: This version of the SDK requires PHP 5.6 or greater.

Include the dependency:

<?php
require_once __DIR__ . '/vendor/autoload.php'; // change path as needed

use Comfortable;

Connect to your Repository and make your first request:

$api = Comfortable\Api::connect('<repository-api-id>', '<api-key>');

try {
  // get all documents stored in comfortable (default limit: 25)
  $results = $api->getDocuments()->execute();  
} catch (\RuntimeException $e) {
  echo 'Comfortalbe SDK returned an error: ' . $e->getMessage();
  exit;
}

Full usage Example

Last updated