Skip to content

snufkin/gathercontent-client

 
 

Repository files navigation

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;

About

PHP library implementing the GatherContent API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.5%
  • Shell 0.5%