rest

REST API for HTML5 chat (updated)

New HTML5 features REST API available

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

The pattern is:

https://chat.html5-chat.com:8008/{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://chat.html5-chat.com:8008/getNumberUsers/1/999


getUsers : get all users in all rooms in chat

This example is for : webmasterid = 1 token = 999

https://chat.html5-chat.com:8008/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://chat.html5-chat.com:8008/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://chat.html5-chat.com:8008/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://chat.html5-chat.com:8008/getUserStatus/1/300


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

This example is for : webmasterid = 1 roomid = 50

https://chat.html5-chat.com:8008/getUsersInRoom/1/50


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

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

https://chat.html5-chat.com:8008/getNumberUsersInRoom/1/999/50


 

How to use that in php for instance:

$numberOfUsers = file_get_contens("https://chat.html5-chat.com:8008/getNumberUsers/1/999");

2 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

Leave a 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.