Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Cant create room(PHP)

Avatar

Level 1

Im trying to create a room using the LCCS PHP API.

When I call the createRoom function, i get the following error:

Warning: fopen(https://na2.collaboration.adobelivecycle.com:443/darkbearroom) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in/home/content/t/h/u/thung/html/classroom/lccs.php on line 837

the page im using is here:

http://antoniohung.com/classroom/

Here is the source:

<?php

  require_once("lccs.php");

  $title = "LCCS External Authentication Sample";

  ini_set('display_errors', 1);

  #

  # Enter your authentication details below:

  #

  $devuser = "";

  $devpass = "";

  $secret  = "";

$am = new RTCAccount("http://collaboration.adobelivecycle.com/darkbearroom");

$am->login($devuser,$devpass);

try {

$room_array = $am->listRooms();

echo "Print Rooms" . "\n";

print_r($room_array);

$newRoom = $am->createRoom("aroom");

echo "Create Room" . "\n";

print_r($newRoom);

} catch (Exception $ex) {

//  print_r($ex);

  exit;

}

    ?>

I am able to list all the rooms using the listRooms() function,  but I can't create the room.

Any help would be appricated

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Just found a simple fix for me...  I changed line 291 from

$date .= "&{$this->authToken}";

to

$data .= "&{$this->authToken}";

I was getting an error daying undefined variable date...  Fixed my that issue for me...

Thanks

View solution in original post

4 Replies

Avatar

Former Community Member

Getting a similar issue here with the latest SDK...

Avatar

Correct answer by
Former Community Member

Just found a simple fix for me...  I changed line 291 from

$date .= "&{$this->authToken}";

to

$data .= "&{$this->authToken}";

I was getting an error daying undefined variable date...  Fixed my that issue for me...

Thanks

Avatar

Level 4

Nice catch!   We will fix it ASAP and include it in the next SDK release.

Thanks,

Nikola

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----