채팅방 조회 - DevCamp2Flame/FlameTalk_Server GitHub Wiki

Chatroom get API

Request

Method

GET

URL

/api/chatroom/{userChatroomId}

Header

Method Parameter Description
Content-Type application/json
token {token} access token값

Path Variable

Parameter Type Description Required
userChatroomId Long 유저 채팅방 id Y

Response

Header

Method Parameter Description
statusCode {statusCode} http 상태 코드 값

Body

Field Type Description
code Integer 응답 코드
message String 응답 메세지
data Object data 참고

data

Field Type Description
isOpen Boolean 오픈 채팅방 여부
profileId Long 채팅방에서 사용하는 유저 프로필(또는 오픈 프로필) ID
profileNickname String 채팅방에서 사용하는 유저(또는 오픈 프로필) 닉네임
profileImage String 채팅방에서 사용하는 유저 프로필(또는 오픈 프로필) 이미지 S3 URL
profiles Object List 채팅방에 참여하는 타 유저 프로필 객체 리스트. profiles 참고
files String List 채팅방에서 최근 업로드 된 파일의 S3 URL 리스트. 리스트 최대 길이 4

profiles

Field Type Description
id Long 유저 프로필(또는 오픈 프로필) ID
nickname String 유저(또는 오픈 프로필) 닉네임
image String 유저 프로필(또는 오픈 프로필) 이미지 S3 URL

SUCCESS example

{
    "status": 200,
    "messsage": "채팅방 상세 조회 성공",
    "data": {
        "isOpen": false,
        "profileId": 1,
        "profileNickname": "불꽃 팀장 여니",
        "profileImage": "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_b_20222621172609.JPG",
        "profiles": [
            {
                "id": 1,
                "nickname": "안드 현국",
                "image": "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_hk_20222621172609.JPG"
            },
            {
                "id": 32,
                "nickname": "서버 다롬쥐",
                "image": "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_dr_20222621172609.JPG"
            },
            {
                "id": 13,
                "nickname": "서버 수연쓰",
                "image": "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_sy_20222621172609.JPG"
            }
        ],
        "files": [
            "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_file1_20222621172609.JPG",
            "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_file2_20222621172609.JPG",
            "https://flametalk-bucket.s3.ap-northeast-2.amazonaws.com/profile/flametalk_file3_20222621172609.JPG"
        ]
    }
}

Error Code

Code Error Messsage
400 Bad Request
401 Unauthorized
404 File Not Found
500 Server Error

FAIL example

{
    "status": 404,
    "message": "존재하지 않는 채팅방입니다.",
    "error": "NOT_FOUND",
    "code": "CHATROOM_NOT_FOUND",
    "timestamp": "2022-01-18T19:30:16.3072905",
}