Chat Rooms

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.

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
}