rest

REST API for HTML5 chat (updated)

New HTML5 features REST API available (updated Nov 2020)

These features are only for SUBSCRIBED ussers.

-> Log in into your chatadmin / developers panel to get your REST API URL.

We are adding new REST interfaces that allow users to get some informations about their chat.

The pattern is:

https://YOUR_REST_API_LINK:2083/{action}/{webmasterid}/{token}

For now we added these REST APIs:


getNumberUsers: allows to get the number of users in all rooms in chat!

This example is for : webmasterid = 1 token = 999

https://YOUR_REST_API_LINK:2083/getNumberUsers/1/999


getUsers : get all users in all rooms in chat

This example is for : webmasterid = 1 token = 999

https://YOUR_REST_API_LINK:2083/getUsers/1/999


getPerformers : get all performers in a namespace webmasterid (performers = users whose role = ‘performer’)

This example is for : webmasterid = 1 token = 999

https://YOUR_REST_API_LINK:2083/getPerformers/1/999



getOnlinePerformers : get all online performers in a namespace webmasterid (performers = users whose role = ‘performer’)

This example is for : webmasterid = 1 token = 999

https://YOUR_REST_API_LINK:2083/getOnlinePerformers /1/999


getUserStatus: get the status of userid in a namespace webmasterid  (returns: “online” or “offline”  or “busy”)

This example is for : webmasterid = 1 userid= 300

https://YOUR_REST_API_LINK:2083/getUserStatus/1/300


getUsersInRoom: get all users in a room roomid of namespace webmasterid

This example is for : webmasterid = 1 roomid = 50

https://YOUR_REST_API_LINK:2083/getUsersInRoom/1/50/token


getNumberUsersInRoom: return the number of users of a room roomid in namespace webmasterid

This example is for : webmasterid = 1 roomid = 50, token=999

https://YOUR_REST_API_LINK:2083/getNumberUsersInRoom/1/50/999


How to use that in php for instance: (we suppose your YOUR_REST_API_LINK is https://chat.html5-chat.com which can be DIFFERENT on your website: connect to chatadmin -> developers  to get yours)

$numberOfUsers = file_get_contents("https://chat.html5-chat.com:2083/getNumberUsers/1/50/999");

getRooms: return your chat rooms.

This example is for : webmasterid = 1, token=999

https://YOUR_REST_API_LINK:2083/getRooms/1/999


How to use that in php for instance: (we suppose your YOUR_REST_API_LINK is https://chat.html5-chat.com which can be DIFFERENT on your website: connect to chatadmin -> developers  to get yours)

$rooms = json_decode(file_get_contents("https://chat.html5-chat.com:2083/getRooms/1/999"));
print_r($rooms)

6 thoughts to “REST API for HTML5 chat (updated)”

  1. You made a type error…
    It should be:
    $numberOfUsers = file_get_contents(“https://chat.html5-chat.com:8008/getNumberUsers/1/999”);

    ( contents and not contens )

    regards
    Paul

  2. Hi
    Could anyone explain for me how to get only the “name” extracted from , getUsers request ?, would be great with examples for the different “Requests” , in PHP and/or Javascript

    Regards Jorgen

  3. Kann Mann das html5-chat im Chat als url erstellen mit einen anderen url Chatnameboder ist das mein feste url Seite für alle Benutzer für den Chat.

Leave a Reply to Nicklas Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.