本文整理汇总了PHP中HttpRequest::wiziq_do_post_request方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpRequest::wiziq_do_post_request方法的具体用法?PHP HttpRequest::wiziq_do_post_request怎么用?PHP HttpRequest::wiziq_do_post_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpRequest
的用法示例。
在下文中一共展示了HttpRequest::wiziq_do_post_request方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AddAttendee
function AddAttendee($secretAcessKey, $access_key, $webServiceUrl)
{
require_once "AuthBase.php";
$authBase = new AuthBase($secretAcessKey, $access_key);
$XMLAttendee = "<attendee_list>\n\t\t\t<attendee>\n\t\t\t <attendee_id><![CDATA[101]]></attendee_id>\n\t\t\t <screen_name><![CDATA[john]]></screen_name>\n <language_culture_name><![CDATA[es-ES]]></language_culture_name>\n\t\t\t</attendee>\n\t\t\t<attendee>\n\t\t\t <attendee_id><![CDATA[102]]></attendee_id>\n\t\t\t <screen_name><![CDATA[mark]]></screen_name>\n <language_culture_name><![CDATA[ru-RU]]></language_culture_name>\n\t\t\t</attendee>\n\t\t </attendee_list>";
$method = "add_attendees";
$requestParameters["signature"] = $authBase->GenerateSignature($method, $requestParameters);
$requestParameters["class_id"] = "11595";
//required
$requestParameters["attendee_list"] = $XMLAttendee;
$httpRequest = new HttpRequest();
try {
$XMLReturn = $httpRequest->wiziq_do_post_request($webServiceUrl . '?method=add_attendees', http_build_query($requestParameters, '', '&'));
} catch (Exception $e) {
echo $e->getMessage();
}
if (!empty($XMLReturn)) {
try {
$objDOM = new DOMDocument();
$objDOM->loadXML($XMLReturn);
} catch (Exception $e) {
echo $e->getMessage();
}
$status = $objDOM->getElementsByTagName("rsp")->item(0);
$attribNode = $status->getAttribute("status");
if ($attribNode == "ok") {
$methodTag = $objDOM->getElementsByTagName("method");
echo "<br>method=" . ($method = $methodTag->item(0)->nodeValue);
$class_idTag = $objDOM->getElementsByTagName("class_id");
echo "<br>class_id=" . ($class_id = $class_idTag->item(0)->nodeValue);
$add_attendeesTag = $objDOM->getElementsByTagName("add_attendees")->item(0);
echo "<br>add_attendeesStatus=" . ($add_attendeesStatus = $add_attendeesTag->getAttribute("status"));
$attendeeTag = $objDOM->getElementsByTagName("attendee");
$length = $attendeeTag->length;
for ($i = 0; $i < $length; $i++) {
$attendee_idTag = $objDOM->getElementsByTagName("attendee_id");
echo "<br>attendee_id=" . ($attendee_id = $attendee_idTag->item($i)->nodeValue);
$attendee_urlTag = $objDOM->getElementsByTagName("attendee_url");
echo "<br>attendee_url=" . ($attendee_url = $attendee_urlTag->item($i)->nodeValue);
}
} else {
if ($attribNode == "fail") {
$error = $objDOM->getElementsByTagName("error")->item(0);
echo "<br>errorcode=" . ($errorcode = $error->getAttribute("code"));
echo "<br>errormsg=" . ($errormsg = $error->getAttribute("msg"));
}
}
}
//end if
}
示例2: DownloadRecording
function DownloadRecording($secretAcessKey, $access_key, $webServiceUrl)
{
require_once "AuthBase.php";
$authBase = new AuthBase($secretAcessKey, $access_key);
$method = "download_recording";
$requestParameters["signature"] = $authBase->GenerateSignature($method, $requestParameters);
$requestParameters["class_id"] = "15754";
$requestParameters["recording_format"] = "zip";
$httpRequest = new HttpRequest();
try {
$XMLReturn = $httpRequest->wiziq_do_post_request($webServiceUrl . '?method=download_recording', http_build_query($requestParameters, '', '&'));
echo $XMLReturn;
} catch (Exception $e) {
header('Content-type: text/html');
echo $e->getMessage();
}
}
示例3: CancelClass
function CancelClass($secretAcessKey, $access_key, $webServiceUrl, $id)
{
require_once "AuthBase.php";
$authBase = new AuthBase($secretAcessKey, $access_key);
$method = "cancel";
$requestParameters["signature"] = $authBase->GenerateSignature($method, $requestParameters);
$requestParameters["class_id"] = $id;
$httpRequest = new HttpRequest();
try {
$XMLReturn = $httpRequest->wiziq_do_post_request($webServiceUrl . '?method=cancel', http_build_query($requestParameters, '', '&'));
} catch (Exception $e) {
echo $e->getMessage();
}
if (!empty($XMLReturn)) {
try {
$objDOM = new DOMDocument();
$objDOM->loadXML($XMLReturn);
} catch (Exception $e) {
echo $e->getMessage();
}
$status = $objDOM->getElementsByTagName("rsp")->item(0);
$attribNode = $status->getAttribute("status");
if ($attribNode == "ok") {
$this->result['state'] = 1;
$methodTag = $objDOM->getElementsByTagName("method");
echo "method=" . ($method = $methodTag->item(0)->nodeValue);
$cancelTag = $objDOM->getElementsByTagName("cancel")->item(0);
echo "<br>cancel=" . ($cancel = $cancelTag->getAttribute("status"));
$this->result['successMsg'] = "<br>cancel=" . ($cancel = $cancelTag->getAttribute("status"));
} else {
if ($attribNode == "fail") {
$this->result['state'] = 0;
$error = $objDOM->getElementsByTagName("error")->item(0);
echo "<br>errorcode=" . ($errorcode = $error->getAttribute("code"));
echo "<br>errormsg=" . ($errormsg = $error->getAttribute("msg"));
$this->result['errorMsg'] = $errormsg = $error->getAttribute("msg");
}
}
}
//end if
}
示例4: ModifyClass
function ModifyClass($secretAcessKey, $access_key, $webServiceUrl, $array = array())
{
require_once "AuthBase.php";
$authBase = new AuthBase($secretAcessKey, $access_key);
$method = "modify";
$requestParameters["signature"] = $authBase->GenerateSignature($method, $requestParameters);
$requestParameters["class_id"] = $array['class_id'];
$requestParameters["start_time"] = $array['start_time'];
$requestParameters["title"] = $array['title'];
//Required
$requestParameters["duration"] = $array['duration'];
//optional
$requestParameters["time_zone"] = "Africa/Cairo";
//optional
$requestParameters["attendee_limit"] = $array['name'];
//optional
$requestParameters["control_category_id"] = "";
//optional
$requestParameters["create_recording"] = "";
//optional
$requestParameters["return_url"] = "";
//optional
$requestParameters["status_ping_url"] = "";
//optional
$requestParameters["language_culture_name"] = "ar-SA";
$httpRequest = new HttpRequest();
try {
$XMLReturn = $httpRequest->wiziq_do_post_request($webServiceUrl . '?method=modify', http_build_query($requestParameters, '', '&'));
} catch (Exception $e) {
echo $e->getMessage();
}
if (!empty($XMLReturn)) {
try {
$objDOM = new DOMDocument();
$objDOM->loadXML($XMLReturn);
} catch (Exception $e) {
echo $e->getMessage();
}
$status = $objDOM->getElementsByTagName("rsp")->item(0);
$attribNode = $status->getAttribute("status");
if ($attribNode == "ok") {
$this->result['state'] = 1;
$this->result['id'] = $array['class_id'];
$methodTag = $objDOM->getElementsByTagName("method");
echo "method=" . ($method = $methodTag->item(0)->nodeValue);
$modifyTag = $objDOM->getElementsByTagName("modify")->item(0);
echo "<br>modify=" . ($modify = $modifyTag->getAttribute("status"));
} else {
if ($attribNode == "fail") {
$this->result['state'] = 0;
$error = $objDOM->getElementsByTagName("error")->item(0);
echo "<br>errorcode=" . ($errorcode = $error->getAttribute("code"));
echo "<br>errormsg=" . ($errormsg = $error->getAttribute("msg"));
}
}
}
//end if
}
示例5: editteacher
function editteacher($secretAcessKey, $access_key, $webServiceUrl, $array = array())
{
require_once "AuthBase.php";
$authBase = new AuthBase($secretAcessKey, $access_key);
$method = "edit_teacher";
$requestParameters["signature"] = $authBase->GenerateSignature($method, $requestParameters);
#for teacher account pass parameter 'presenter_email'
//This is the unique email of the presenter that will identify the presenter in WizIQ. Make sure to add
//this presenter email to your organization�s teacher account. � For more information visit at: (http://developer.wiziq.com/faqs)
$requestParameters["teacher_id"] = $array['teacher_id'];
$requestParameters["name"] = $array['name'];
$requestParameters["email"] = $array['email'];
$requestParameters["password"] = $array['password'];
$requestParameters["image"] = $array['image'];
$requestParameters["phone_number"] = $array['phone_number'];
$requestParameters["about_the_teacher"] = "Online Facilitator and Teacher, British Columbia, Canada";
$requestParameters["is_active"] = $array['is_active'];
$httpRequest = new HttpRequest();
try {
$XMLReturn = $httpRequest->wiziq_do_post_request($webServiceUrl . '?method=edit_teacher', http_build_query($requestParameters, '', '&'));
} catch (Exception $e) {
echo $e->getMessage();
}
if (!empty($XMLReturn)) {
try {
$objDOM = new DOMDocument();
$objDOM->loadXML($XMLReturn);
} catch (Exception $e) {
echo $e->getMessage();
}
$status = $objDOM->getElementsByTagName("rsp")->item(0);
$attribNode = $status->getAttribute("status");
if ($attribNode == "ok") {
$this->result['state'] = 1;
$methodTag = $objDOM->getElementsByTagName("method");
//echo "method=".$method=$methodTag->item(0)->nodeValue;
// $class_idTag=$objDOM->getElementsByTagName("class_id");
// echo "<br>Class ID=".$class_id=$class_idTag->item(0)->nodeValue;
// $recording_urlTag=$objDOM->getElementsByTagName("recording_url");
// echo "<br>recording_url=".$recording_url=$recording_urlTag->item(0)->nodeValue;
// $presenter_emailTag=$objDOM->getElementsByTagName("presenter_email");
// echo "<br>presenter_email=".$presenter_email=$presenter_emailTag->item(0)->nodeValue;
// $presenter_urlTag=$objDOM->getElementsByTagName("presenter_url");
// echo "<br>presenter_url=".$presenter_url=$presenter_urlTag->item(0)->nodeValue;
} else {
if ($attribNode == "fail") {
$this->result['state'] = 0;
$error = $objDOM->getElementsByTagName("error")->item(0);
//echo "<br>errorcode=".$errorcode = $error->getAttribute("code");
$this->result['errorMsg'] = "<br>errormsg=" . $error->getAttribute("msg");
}
}
}
//end if
}
示例6: addschedule
function addschedule($secretAcessKey, $access_key, $webServiceUrl, $array = array())
{
require_once "AuthBase.php";
$authBase = new AuthBase($secretAcessKey, $access_key);
$method = "create";
$requestParameters["signature"] = $authBase->GenerateSignature($method, $requestParameters);
#for teacher account pass parameter 'presenter_email'
//This is the unique email of the presenter that will identify the presenter in WizIQ. Make sure to add
//this presenter email to your organization�s teacher account. � For more information visit at: (http://developer.wiziq.com/faqs)
$requestParameters["presenter_email"] = $array['presenter_email'];
#for room based account pass parameters 'presenter_id', 'presenter_name'
//$requestParameters["presenter_id"] = "40";
//$requestParameters["presenter_name"] = "vinugeorge";
$requestParameters["start_time"] = $array['start_time'];
$requestParameters["title"] = $array['title'];
//Required
$requestParameters["duration"] = $array['duration'];
//optional
$requestParameters["time_zone"] = $array['time_zone'];
//optional
$requestParameters["attendee_limit"] = $array['attendee_limit'];
//optional
$requestParameters["control_category_id"] = "";
//optional
$requestParameters["create_recording"] = "";
//optional
$requestParameters["return_url"] = "";
//optional
$requestParameters["status_ping_url"] = "";
//optional
$requestParameters["language_culture_name"] = "ar-SA";
$httpRequest = new HttpRequest();
try {
$XMLReturn = $httpRequest->wiziq_do_post_request($webServiceUrl . '?method=create', http_build_query($requestParameters, '', '&'));
} catch (Exception $e) {
echo $e->getMessage();
}
if (!empty($XMLReturn)) {
try {
$objDOM = new DOMDocument();
$objDOM->loadXML($XMLReturn);
} catch (Exception $e) {
echo $e->getMessage();
}
$status = $objDOM->getElementsByTagName("rsp")->item(0);
$attribNode = $status->getAttribute("status");
if ($attribNode == "ok") {
$this->result['state'] = 1;
$methodTag = $objDOM->getElementsByTagName("method");
//echo "method=".$method=$methodTag->item(0)->nodeValue;
$class_idTag = $objDOM->getElementsByTagName("class_id");
$this->result['id'] = $class_idTag->item(0)->nodeValue;
$recording_urlTag = $objDOM->getElementsByTagName("recording_url");
//echo "<br>recording_url=".$recording_url=$recording_urlTag->item(0)->nodeValue;
$this->result['recording_url'] = $recording_urlTag->item(0)->nodeValue;
$presenter_emailTag = $objDOM->getElementsByTagName("presenter_email");
//echo "<br>presenter_email=".$presenter_email=$presenter_emailTag->item(0)->nodeValue;
$this->result['presenter_email'] = $presenter_emailTag->item(0)->nodeValue;
$presenter_urlTag = $objDOM->getElementsByTagName("presenter_url");
$this->result['presenter_url'] = $presenter_urlTag->item(0)->nodeValue;
} else {
if ($attribNode == "fail") {
$this->result['state'] = 0;
$error = $objDOM->getElementsByTagName("error")->item(0);
//echo "<br>errorcode=".$errorcode = $error->getAttribute("code");
$this->result['errorMsg'] = "<br>" . ($errormsg = $error->getAttribute("msg"));
}
}
}
//end if
}
示例7: fetchtecher
function fetchtecher($secretAcessKey, $access_key, $webServiceUrl, $id = 0)
{
require_once "AuthBase.php";
$authBase = new AuthBase($secretAcessKey, $access_key);
$method = "get_teacher_details";
$requestParameters["signature"] = $authBase->GenerateSignature($method, $requestParameters);
if ($id) {
$requestParameters["teacher_id"] = $id;
}
#for teacher account pass parameter 'presenter_email'
$httpRequest = new HttpRequest();
try {
$XMLReturn = $httpRequest->wiziq_do_post_request($webServiceUrl . '?method=get_teacher_details', http_build_query($requestParameters, '', '&'));
} catch (Exception $e) {
echo $e->getMessage();
}
if (!empty($XMLReturn)) {
try {
$objDOM = new DOMDocument();
$objDOM->loadXML($XMLReturn);
} catch (Exception $e) {
echo $e->getMessage();
}
$status = $objDOM->getElementsByTagName("rsp")->item(0);
$attribNode = $status->getAttribute("status");
if ($attribNode == "ok") {
$methodTag = $objDOM->getElementsByTagName("teacher_id");
for ($i = 0; $i < $methodTag->length; $i++) {
$this->result[$i]['id'] = $methodTag->item($i)->nodeValue;
}
$methodTag = $objDOM->getElementsByTagName("name");
for ($i = 0; $i < $methodTag->length; $i++) {
$this->result[$i]['name'] = $methodTag->item($i)->nodeValue;
}
$methodTag = $objDOM->getElementsByTagName("email");
for ($i = 0; $i < $methodTag->length; $i++) {
$this->result[$i]['email'] = $methodTag->item($i)->nodeValue;
}
$methodTag = $objDOM->getElementsByTagName("image");
for ($i = 0; $i < $methodTag->length; $i++) {
$this->result[$i]['image'] = $methodTag->item($i)->nodeValue;
}
$methodTag = $objDOM->getElementsByTagName("phone_number");
for ($i = 0; $i < $methodTag->length; $i++) {
$this->result[$i]['phone_number'] = $methodTag->item($i)->nodeValue;
}
$methodTag = $objDOM->getElementsByTagName("password");
for ($i = 0; $i < $methodTag->length; $i++) {
$this->result[$i]['password'] = $methodTag->item($i)->nodeValue;
}
$methodTag = $objDOM->getElementsByTagName("is_active");
for ($i = 0; $i < $methodTag->length; $i++) {
$this->result[$i]['is_active'] = $methodTag->item($i)->nodeValue;
}
/*$class_idTag=$objDOM->getElementsByTagName("class_id");
echo "<br>Class ID=".$class_id=$class_idTag->item(0)->nodeValue;
$recording_urlTag=$objDOM->getElementsByTagName("recording_url");
echo "<br>recording_url=".$recording_url=$recording_urlTag->item(0)->nodeValue;
$presenter_emailTag=$objDOM->getElementsByTagName("presenter_email");
echo "<br>presenter_email=".$presenter_email=$presenter_emailTag->item(0)->nodeValue;
$presenter_urlTag=$objDOM->getElementsByTagName("presenter_url");
echo "<br>presenter_url=".$presenter_url=$presenter_urlTag->item(0)->nodeValue;*/
} else {
if ($attribNode == "fail") {
$error = $objDOM->getElementsByTagName("error")->item(0);
echo "<br>errorcode=" . ($errorcode = $error->getAttribute("code"));
echo "<br>errormsg=" . ($errormsg = $error->getAttribute("msg"));
}
}
}
//end if
}