我使用gotowebinar服务从自定义目标网页注册用户: API LINK https://goto-developer.logmeininc.com/ 如何创建正确的流程以将用户注册到网络研讨会? 以及如何获得organizer_id?
感谢
这是我的代码。
$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
答案 0 :(得分:0)
这里的解决方案,在git hub中 https://github.com/zakir-hyder/Citrix-GoToWebinar-PHP-Library
在向脚本提供详细信息后,您必须先创建应用程序:
<script type="text/javascript">
$(function() {
$( "#vname" ).autocomplete({
source: function(request, response) {
$.ajax({
url: "<?=base_url(); ?>vendor/search?term="+request.term,
dataType: "json",
type: "GET",
success: function(data){
response($.map(data, function (value, key) {
return {
label: value.text,
value: value.id
}
}));
}
});
},
minLength: 2,
select: function(event, ui) {
//select event of autocomplete
console.log("id : ",ui.item.value);
console.log("text : ",ui.item.label);
$('#vname').val(ui.item.label);
return false;
},
});
});
</script>
代码示例:
$citrix = new Citrix('API Key');
$citrix->set_organizer_key('organizer_key');
$citrix->set_access_token('access_token');