flipminds/gotowebinar

GotoWebinar REST API wrapper. Uses the new api.getgo.com/G2W/rest endpoint

v1.0.3 2017-09-18 19:18 UTC

This package is not auto-updated.

Last update: 2024-05-29 19:54:25 UTC


README

Description

A simple wrapper around the the GotoWebinar API.

Install via Composer

We recommend installing this package with Composer.

Run in your project root:

composer require flipminds/gotowebinar:~1.0.0

Simple Usage

use FlipMinds\GotoWebinar\GotoWebinar;
  
$credentials = [
    'username' => ''
    'password' => ''
    'consumerKey' => ''
];
 
$gtw = new GotoWebinar($credentials);
 
$webinars = $gtw->getUpcoming();
  
$key = ''
foreach($webinars as $webinar) { 
    if (!$key) $key = $webinar->webinarKey;
}
 
$result = $gtw->createRegistrant($key, 'firstname','lastname','email);
print_r($result);

See the examples folder for more usages examples.

Caching the Authentication Token

By default GotoWebinar Authentication Tokens are valid for 356 days. Caching the token result in one less round trip to GotoWebinar servers.

You can use the getAuth() method call to retrieve an array of data that can be cached. You can use this array as a second argument to the constructor.

You can also set a callback to capture the authentication array after authenticating with GotoWebinar servers.

// $auth =  getfromcache()
   
$gtw = new GotoWebinar($credentials, $auth); // see Above
 
$gtw->setAuthCallback(function($auth) {
 // save $auth to cache 
});