This is why I have created PHP API [1] :))) I guess you need to take a look at this [2] line It will not work if both params will be encoded
[1] https://github.com/openmeetings/openmeetings-api-plugin [2] https://github.com/openmeetings/openmeetings-api-plugin/blob/master/src/main/scripts/OmGateway.php#L97 On Fri, Aug 26, 2016 at 3:00 AM, Andre Wruszczak <[email protected]> wrote: > Dear Openmeetings-Team! > Thank you for submitting the REST API Sample on your homepage! > I am currently struggling with reproducing the ajax call shown in the > sample with php. > > > > My url is pretty much this = http://localhost:5080/ > openmeetings/services/user/hash?sid=SOMEVALIDSID > > > > I am preparing the data like this : > > $user = array( > > 'firstname' => 'John', > > 'lastname' => 'Doe', > > 'externalId' => 'uid1', > > 'externalType' => 'myCMS', > > 'login' => 'superjohn'); > > $roomOptions = array( > > 'roomId' => 5, > > 'moderator' => true, > > 'showAudioVideoTest' => true); > > > > $data = json_encode(array('user' => $user, 'options' => $roomOptions), > JSON_FORCE_OBJECT); > > > > And curl it like this : > > $curl = curl_init(); > > curl_setopt_array($curl, [ > > CURLOPT_RETURNTRANSFER => 1, > > CURLOPT_POST => 1, > > CURLOPT_POSTFIELDS => $data, > > CURLOPT_URL => $url, > > CURLOPT_USERAGENT => 'Reproducing’, > > CURLOPT_SSLVERSION => 3, > > CURLOPT_SSL_VERIFYHOST => 0, > > CURLOPT_SSL_VERIFYPEER => 0 > > ]); > > > > I tried it many times with different versions of the data etc. and I > always get either (415 unsupported media type) or (500 Internal Server > Error) without any (at least for me) helpful further informations. > > I have included one of the error.html. > > > > I would really appreciate some help at this stage. Maybe I should send the > request with the “wadl” in the url? > > > > Thanks in advance, > > > > -Andre > > > > > -- WBR Maxim aka solomax
