How to directly enter a room ?

(UPDATED – fixed bug)
New feature: It is now possible to join a particular room directly at login

2 cases

Let suppose you want to join room id : 1620
(you can find out your room id in your chatadmin)


  1. if you don’t use JWT authentification, just pass the url parameter startRoom
  2. You do use JWT to login, then just inject the parameter: startRoom: id
Where to find the room id ?


so for room : 1620, you just need to add


So for instance your JSON will be:


$json = json_encode(array('username'=>'myUsername', 'password'=>'myChatAccountPassword', 'gender'=>'male', 'role'=>'user', 
'image'=>base64_encode(''), 'profile'=>'', 'startRoom'=>1620));

JWT: a quicker and simpler version using the HTML5 service

Here is a quicker and simpler version of integrating  HTML5 chat into an existing website than the JWT version described in that post

The bottom sample is a php sample, but you can easily adapt it to JS or ASP in needed

Step 1: you create an array of your user such as:

$json = json_encode(array(
    'username'  =>'myUsername',
    'password'  =>'myChatAccountPassword',
    'gender'    =>'male',
    'role'      =>'user',
    'image'     =>base64_encode(''),
    'profile'   =>''

Step 2 : you encode it using the html5 JWT online service

$encoded = file_get_contents("".base64_encode($json));

Step 3 : you inject that encoded string into your JS script

<script src="<?=webmasterid?>/<?=$encoded?>"></script>

And that’s ALL:

role : can be admin,  user, guest,  dj, custom1, custom2, custom3

avatar is the http:// image of the expected avatar

profile: the link to the user profile (if available)

startRoom : the id of the room where to start in (roomid is an integer number)

Replace the webmasterid in script by your script id (webmasterid, a positive integer you can find in your chatadmin panel)

If you want to use JWT on your server, please refer to this post.

<?php $json = json_encode(array('username'=>'myUsername', 'password'=>'myPassword', 'gender'=>'male', 'role'=>'user', 'profile'=>'', 'image'=>''));
$encoded = file_get_contents("".base64_encode($json), 'startRoom'=>5);
<!doctype html>
<html lang="en">
    <meta charset="UTF-8">
    <title>HTML5 chat</title>

<div style="width: 1024px;height: 800px;">
    <script src="<?=$encoded?>"></script>


Notice: if file_get_contents is DISABLED on your hosting, you can use the curl

$curl= curl_init();
curl_setopt_array($curl, array(
      CURLOPT_URL => "".base64_encode($json)
$encoded = curl_exec($curl);