Page Contents
Create a chat room
For creating a chat room, you can use POST method.
Request:
POST /api/chatrooms?roomname=Sales&roomusers= Sam|1,John|0
roomusers – Username | role.
Role:
1 – Admin.
0 – User.
0 – User.
Response:
Status: 200 OK { "success":true }
Update a chat room
You can use PUT method, to update a chat room.
Request:
PUT /api/chatrooms/[room]?roomname=Sales&roomusers=Smith|1,Sam|0,John|0
[room] – Previous Chat Room Name.
Response:
Status: 200 OK { "success":true }
Delete a chat room
You can use DELETE method,for deleting a chat room.
Request:
DELETE /api/chatrooms/[room]
[room] – Chat Room Name.
Response:
Status: 200 OK { "success":true }
Retrieving a chat room
You can use GET method for retrieving a chatroom.
Request:
GET /api/chatrooms/[room]
[room] – Chat Room Name.
Response:
{ "row":{ "roomname":"Sales", "roomusers":"Smith|1,Sam|0,John|0" }, "success":true }
Retrieving all chat rooms
For retrieving all the chatrooms, you can use GET method.
Request:
GET /api/chatrooms
Response:
{" rows":[ { "roomname":"Sales", "roomusers":"Smith|1,Sam|0,John|0" }, { "roomname":"Support" "roomusers":"Jashua|0,Margrett|0" } ], "success":true }
Retrieving a chat room log
You can use GET method for retrieving a chatroom log as HTML.
Request:
GET /api/chatrooms/logs?[roomkey]=a_20160805110823@conference.com&[fromdate]=2018/07/24&[todate]=2018/07/25
[roomkey] – Chat Room Key.
[fromdate] – Start Date.
[todate] – End Date.
Response:
{ "logs":[ { "<style>*, *:before, *:after {box-sizing: border-box;}....</style><div class='room_log'>...</div>" }, ], "success":true }