Skip to content
PHP library implementing the GatherContent API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src-dev
src
.git-hooks
.gitignore
.gitlab-ci.yml
.travis.yml
README.md
RoboFile.php
composer.json
composer.lock
phpcs.xml
phpunit.xml.dist

README.md

GatherContent REST client

Build Status codecov

Compatible with application/vnd.gathercontent.v0.5+json

Supported endpoints

Basic usage

To create the GatherContentClient simply pass in a Guzzle client in the constructor.

You will need:

  • your e-mail address to log into GatherContent
  • your API key from GatherContent
<?php
$email = 'YOUR_GATHERCONTENT_EMAIL';
$apiKey = 'YOUR_GATHERCONTENT_API_KEY';
$client = new \GuzzleHttp\Client();
$gc = new \Cheppers\GatherContent\GatherContentClient($client);
$gc
  ->setEmail($email)
  ->setApiKey($apiKey);

try {
    $me = $gc->meGet();
}
catch (\Exception $e) {
    echo 'ERROR: ' . $e->getMessage() . PHP_EOL;
    
    exit(1);
}
echo "Email = {$me->email}" . PHP_EOL;
echo "First name = {$me->firstName}" . PHP_EOL;
echo "Last name = {$me->lastName}" . PHP_EOL;
You can’t perform that action at this time.