I using gotowebinar service to register user from custom landing page: API LINK https://goto-developer.logmeininc.com/ How to create the right flow to register user into webinar? and how to get organizer_id ??
thanks
here my code.
$webinar_id = "336-174-566";
$gtwPost = array(
"firstName" => $contact_data['FirstName'],
"lastName" => $contact_data['LastName'],
"email" => $contact_data['Email']
);
$gtwHeaders = array(
"Accept:application/vnd.citrix.g2wapi-v1.1+json",
"Content-Type:application/json",
"Authorization:OAuth oauth_token=xxxxxxxxxx"
);
$this->data['gtw'] = array(
'post' => $gtwPost,
'headers' => $gtwHeaders
);
//Set POST URL for GoToWebinar
$gtw_url = "https://api.citrixonline.com/G2W/rest/organizers/".$organizer_id."/webinars/".$webinar_id."/registrants";
//Start GoToWebinar submission
$curl = @curl_init();
@curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($gtwPost));
@curl_setopt($curl, CURLOPT_URL, $gtw_url);
#@curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
@curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
@curl_setopt($curl, CURLOPT_POST, 1);
@curl_setopt($curl, CURLOPT_HTTPHEADER, $gtwHeaders);
@curl_exec($curl);
$info = @curl_getinfo($curl);
@curl_close($curl);
//End GoToWebinar registrant submission
Solution here, in git hub https://github.com/zakir-hyder/Citrix-GoToWebinar-PHP-Library
you have to create application first, after provide details to the script:
$citrix = new Citrix('API Key');
$citrix->set_organizer_key('organizer_key');
$citrix->set_access_token('access_token');
code example:
<?php
include "citrix.php";
$citrix = new Citrix('API Key');
$citrix->set_organizer_key('organizer_key');
$citrix->set_access_token('access_token');
try
{
$organizer_key = $citrix->get_organizer_key();
$citrix->pr($organizer_key);
}catch (Exception $e) {
$citrix->pr($e->getMessage());
}
try
{
$webinars = $citrix->citrixonline_get_list_of_webinars() ;
$citrix->pr($webinars);
}catch (Exception $e) {
$citrix->pr($e->getMessage());
}
try
{
$response = $citrix->citrixonline_create_registrant_of_webinar('webinar id', $data = array('first_name' => 'First Name', 'last_name' => 'Lastnmae', 'email'=>'email@email.com')) ;
$citrix->pr($response);
}catch (Exception $e) {
$citrix->pr($e->getMessage());
}
try
{
$webinars = $citrix->get_registrants_of_webinars('webinar id') ;
$citrix->pr($webinars);
}catch (Exception $e) {
$citrix->pr($e->getMessage());
}
try
{
$citrix->citrixonline_delete_registrant_of_webinar('webinar id', 'registrant id') ;
}catch (Exception $e) {
$citrix->pr($e->getMessage());
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.