Site icon HTML5chat, free html5 video chat

REST API for HTML5 chat (updated)

rest

rest

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)
Exit mobile version