2017 © Pedro Peláez
 

library citrix

PHP wrapper around Citrix - GoToMeeting and GoToWebinar APIs. Forked from teodortalov/citrix.

image

teodortalov/citrix

PHP wrapper around Citrix - GoToMeeting and GoToWebinar APIs. Forked from teodortalov/citrix.

  • Monday, May 22, 2017
  • by teodortalov
  • Repository
  • 6 Watchers
  • 14 Stars
  • 14,953 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 32 Forks
  • 6 Open issues
  • 5 Versions
  • 9 % Grown

The README.md

Citrix API - PHP wrapper around GoToWebinar APIs - 2015

Install via Composer

require "teodortalov/citrix: *", (*1)

Authenticate and Get Going in 15 seconds

All you need in order to authenticate with Citrix's API is a consumer key, which you can obtain by registering at Citrix Developer Center. After registering and adding your application, you will be given Consumer Key, Consumer Secret, and Callback URL. You need the Consumer Key in order for your application to authenticate with Citrix using this library., (*2)

Direct Authentication

In addition to the Consumer Key, for Direct Authentication you need your username and password, which is the one that you use to login into [GoToWebinar.com][2]., (*3)

You can authenticate to Citrix, and your GoToWebinar account respectively, like so:, (*4)

$client = new \Citrix\Authentication\Direct('CONSUMER_KEY');
$client->auth('USERNAME', 'PASSWORD'); 

Generally, the things you need the most are the access_token and organizer_key. You can retrieve those like this:, (*5)

$client->getAccessToken(); //returns your access token
$client->getOrganizerKey(); //returns the organizer key

The code will handle all the authentication stuff for you, so you don't really have to worry about that., (*6)

Getting upcoming webinars

In order to get all the upcoming webinars, you have to do this:, (*7)

$goToWebinar = new \Citrix\GoToWebinar($client); //@see $client definition above 
$webinars = $goToWebinar->getUpcoming();
var_dump($webinars); //this gives you all upcoming webinars

Getting past webinars

In order to get all the past webinars, you have to do this:, (*8)

$goToWebinar = new \Citrix\GoToWebinar($client); //@see $client definition above 
$webinars = $goToWebinar->getPast();
var_dump($webinars); //this gives you all upcoming webinars

If you would like to get the registration/join URL for a webinar you can do so like this:, (*9)

$webinar = reset($webinars);
$webinar->getRegistrationUrl(); //https://attendee.gotowebinar.com/register/456905497806

Register a user for a webinar

You can really easily register somebody for a webinar. Basically, all you need to do is this:, (*10)

$data = array('email' => 'joe.smith@gmail.com', 'firstName' => 'Joe', 'lastName' => 'Smith');
$consumer = new \Citrix\Entity\Consumer($client);
$consumer->setData($data)->populate();

//register a user for the very first upcoming webinar, @see Getting upcoming webinars
$webinar = reset($webinars);
$webinar->registerConsumer($consumer);

As mentioned above $client you can get from Authenticate and Get Going in 15 seconds section, and $webinar you can get from Getting upcoming webinars section., (*11)

Alternatively, you can register a user for a webinar by providing the webinarKey and the user data directly to the GoToWebinar class like so:, (*12)

$webinarKey = 123123;
$registrantData = array('email' => 'joe.smith@gmail.com', 'firstName' => 'Joe', 'lastName' => 'Smith');

$goToWebinar = new \Citrix\GoToWebinar($client); //@see $client definition above
$goToWebinar->register($webinarKey, $registrantData);

Error handling

The code does handle errors but it fails silently. You can check for errors like so:, (*13)

$data = array('email' => 'joe.smith@gmail.com', 'firstName' => 'Joe', 'lastName' => 'Smith');
$consumer = new \Citrix\Entity\Consumer($client);
$consumer->setData($data)->populate();

//register a user for the very first upcoming webinar, @see Getting upcoming webinars
$webinar = reset($webinars);
$registration = $webinar->registerConsumer($consumer);

if($registration->hasErrors()){
   //get the first error that occurred and use it as the exception message
   throw new \Exception($registration->getError());
}

//no errors, continue...
die('Registration was successful.');

You can also display/get all errors like so:, (*14)

$registration->getErrors();

Also you can push new errors like so:, (*15)

$registration->addError('Something went wrong!!!');

Error handling should be available everywhere, so you should always be able to call hasErrors() and check for errors., (*16)

Contributions - Fork, Fork, Fork

If you would like to help maintain this project and/or if you have any questions or comments about the library's design or implementation I'd love to hear from you., (*17)

What's coming?

More stuff, first and foremoest in-like documentation, so your IDE works. Unit testing, and more from Citrix API., (*18)

The Versions

22/05 2017

dev-master

9999999-dev

PHP wrapper around Citrix - GoToMeeting and GoToWebinar APIs. Forked from teodortalov/citrix.

  Sources   Download

MIT

by Teodor Talov

gotowebinar citrix citrix api gotowebinar api gotomeeting api

04/05 2016

1.2

1.2.0.0

PHP wrapper around Citrix - GoToMeeting and GoToWebinar APIs. Forked from teodortalov/citrix.

  Sources   Download

MIT

by Teodor Talov

gotowebinar citrix citrix api gotowebinar api gotomeeting api

08/05 2015

1.1

1.1.0.0

PHP wrapper around Citrix - GoToMeeting and GoToWebinar APIs. Forked from teodortalov/citrix.

  Sources   Download

MIT

by Teodor Talov

gotowebinar citrix citrix api gotowebinar api gotomeeting api

08/05 2015

dev-1.1-dev

dev-1.1-dev

PHP wrapper around Citrix - GoToMeeting and GoToWebinar APIs. Forked from teodortalov/citrix.

  Sources   Download

MIT

by Teodor Talov

gotowebinar citrix citrix api gotowebinar api gotomeeting api

26/07 2014

1.0

1.0.0.0

PHP wrapper around Citrix - GoToMeeting and GoToWebinar APIs

  Sources   Download

MIT

by Teodor Talov

gotowebinar citrix citrix api gotowebinar api gotomeeting api