Created
November 26, 2014 00:49
-
-
Save hathaway/6a9fadc2049e30bf3c0a to your computer and use it in GitHub Desktop.
GoToWebinar register via API example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create string for GoToWebinar from same form POST data | |
$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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment