Skip to content
Neng Sitiporn edited this page Nov 3, 2022 · 5 revisions

Chat Module Api

get All roomchat for each user

GET /chat

response

{ roomid : "1234" , roomName : "toddy" ,roomtype : "individual" },
{ roomid : "2341" , roomName : "oil" , roomtype : "individual"},
{ roomid : "4521" , roomName : "maki group" , roomtype : "group"} 

get chat for each room

GET /chat/:roomid

request

query params

Parameter Type Description
roomid String RoomID

response

{ masseageID : "4521" , senderID : "64130500249" ,messageType : "pure" createAt :'2022-01-1 00:00:01' message :"Happy new year 🎉"},
{ masseageID : "21453" , senderID : "64130500249" ,messageType : "song" createAt :'2022-01-1 00:00:10' 
message :"https://open.spotify.com/track/7fyVBKYJYMP42nNr9RFTAT?si=68c70d2b01de4890"}

Send message on chat room

request

POST /chat/:roomid

body json

Parameter Type Description
message String massage

response

add massage to massage table in database

Delete massage from room chat

request

POST /chat/:roomid

body json

Parameter Type Description
message String massage

response

delete massage to massage table in database

Send message on chat room

request

DELETE /chat/:roomid

body json

Parameter Type Description
message String massage

response

delete massage to massage table in database

Delete Room chat

request

DELETE /chat/:roomid

params

Parameter Type Description
RoomID String RoomID

response

Delete room from database

Update property room

request

PUT /chat/:roomid

body json

Parameter Type Description
color String color theme
userID String userID
nickname String new user nickName
RoomID String RoomID

response

Update chat property

Clone this wiki locally