채팅방 생성 - DevCamp2Flame/FlameTalk_Server GitHub Wiki

Chatroom create API

Request

Method

POST

URL

/api/chatroom

Header

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

Body

Field Type Description Required
hostId String 채팅방 개설자의 유저 id Y
hostOpenProfileId Long 채팅방 개설자의 오픈 프로필 id. 오픈 프로필 사용하지 않는 경우 Null N
isOpen boolean 오픈 채팅방 여부 Y
users String List 개설자를 포함한 채팅방에 참여하는 유저 id 리스트 Y
title String 채팅방 이름 N
thumbnail String 채팅방 썸네일 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
hostId String 채팅방 개설자의 유저 id
count int 채팅방 참여 인원
isOpen Boolean 오픈 채팅방 여부
url String 오픈 채팅방의 경우 생성된 채팅방 url. 오픈 채팅방이 아닌 경우 null
title String 채팅방 이름
thumbnails String List 채팅방 썸네일. 최대 길이 4

SUCCESS example

{
    "status": 201,
    "messsage": "채팅",
    "data": {
        "chatroomId": "b49c3059-e509-42d7-add2-9156d87a7db3",
        "userChatroomId": 4,
        "hostId": "1643163512893324414",
        "count": 4,
        "isOpen": false,
        "url": null,
        "title": 4,
        "thumbnails": [
            "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"
        ]        
    }
}

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",
}