Thanks for your reply! Here is the code I use. I seem to fulfill all the requirements, but I get an error.
meetingID='sample_id';
$SALT = 'sample_salt';
$configXml =$configXml->asXML(); //
function setConfigXmlForMeeting( $meetingID, $xmlConfig, $SALT, $URL ) {
$url_join = $URL."api/setConfigXML.xml?";
$baseString = 'configXML='.urlencode(encodeURI($xmlConfig)).'&meetingID='.urlencode($meetingID);
$checksum = sha1('setConfigXML'.$baseString.$SALT);
$params = $baseString.'&checksum='.$checksum;
$xml = bbb_wrap_simplexml_load_file_params($url_join, $params, 'application/x-www-form-urlencoded; charset=UTF-8');
if( $xml && $xml->returncode == 'SUCCESS' ) {
return ( $xml->configToken );
}
else if( $xml ) {
return ( (string)$xml->messageKey.' : '.(string)$xml->message );
}
else {
return ('Unable to fetch URL '.$url_join.$params );
}
}
function encodeURI($url) {
$unescaped = array(
'%2D'=>'-','%5F'=>'_','%2E'=>'.','%21'=>'!', '%7E'=>'~',
'%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')'
);
$reserved = array(
'%3B'=>';','%2C'=>',','%2F'=>'/','%3F'=>'?','%3A'=>':',
'%40'=>'@','%26'=>'&','%3D'=>'=','%2B'=>'+','%24'=>'$'
);
$score = array(
'%23'=>'#'
);
return strtr(urlencode($url), array_merge($reserved,$unescaped,$score));
}
function bbb_wrap_simplexml_load_file_params($url, $params, $contentType){
if (extension_loaded('curl'))
{
$ch = curl_init() or die ( curl_error() );
$timeout = 10;
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_POST, true);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $params);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array("Content-type: ".$contentType)); // application/x-www-form-urlencoded; charset=UTF-8"));
$data = curl_exec( $ch );
curl_close( $ch );
if($data)
{
$tr=new SimpleXMLElement($data);
var_dump($tr);
return ($tr);
}
else
return false;
}
return null;
}
I can not write to the development team, I did not accept the request to join the group.
I tried to exclude the function "encodeURI". It seems to me a problem somewhere in a line of a line "$ configXml-> asXML ()" .... Probably some additional conversions for received xml are necessary?