채팅방 대화상대 초대 - DevCamp2Flame/FlameTalk_Server GitHub Wiki
UserChatroom create API
Request
Method
POST
URL
/api/chatroom/join
Header
| Method |
Parameter |
Description |
| Content-Type |
application/json |
|
| token |
{token} |
access token값 |
Body
| Field |
Type |
Description |
Required |
| chatroomId |
String |
채팅 방 id |
Y |
| userId |
String |
유저 id |
Y |
| lastReadMessageId |
String |
초대된 시점을 알려주는 채팅 메세지 ID |
Y |
| openProfileId |
Long |
오픈 프로필 id |
N |
Response
Header
| Method |
Parameter |
Description |
| statusCode |
{statusCode} |
|
Body
| Field |
Type |
Description |
| status |
Integer |
응답 코드 |
| message |
String |
응답 메세지 |
| data |
Object |
생성된 유저 채팅방 정보. data 참고 |
data
| Field |
Type |
Description |
| chatroomId |
String |
참여한 채팅방 id |
| userChatroomId |
Long |
생성된 유저의 채팅방 id |
| lastReadMessageId |
String |
초대된 시점을 알려주는 채팅 메세지 ID |
| openProfileId |
Long |
채팅방에서 사용하는 유저 오픈 프로필 id. 오픈 프로필을 사용하지 않는 경우 null |
| count |
int |
채팅방 인원 수 |
| isOpen |
Boolean |
오픈 채팅방 여부 |
| title |
String |
채팅방 이름 |
| thumbnail |
String List |
채팅방 썸네일 이미지 리스트. 리스트 최대 길이 4 |
SUCCESS example
{
"status": 201,
"messsage": "채팅방 입장 성공",
"data": {
"chatroomId": "b49c3059-e509-42d7-add2-9156d87a7db3",
"userChatroomId": 12,
"lastReadMessageId": "b49c3059-e509-42d7-add2-9156d87a7db3",
"openProfileId": null,
"count": 4,
"isOpen": false,
"title": "김다롬, 김현국, 팀장 박소연, 최수연",
"thumbnail": [
"https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_a_20222621172609.JPG",
"https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_b_20222621172609.JPG",
"https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_c_20222621172609.JPG",
"https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_d_20222621172609.JPG"
]
}
}
Error Code
| Code |
Error Messsage |
| 400 |
Bad Request |
| 401 |
Unauthorized |
| 500 |
Server Error |
FAIL example
{
"status": 400,
"message": "잘못된 요청입니다.",
"error": "BAD_REQUEST",
"code": "BAD_REQUEST",
"timestamp": "2022-01-18T19:30:16.3072905",
}