오픈 프로필 생성 - DevCamp2Flame/FlameTalk_Server GitHub Wiki

Open Profile create API

Request

Method

POST

URL

/api/membership/open-profile

Header

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

Body

Field Type Description Required
userId String 유저 id Y
nickname String 오픈 프로필 닉네임. 최대 길이 20 Y
imageUrl String 오픈 프로필 사진 S3 URL N
description String 오픈 프로필 상태 메세지. 최대 길이 60 N

Response

Header

Method Parameter Description
statusCode {statusCode}
Location api/membership/open-profile/{openProfileId} 성공한 경우 생성된 오픈 프로필 id

Body

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

data

Field Type Description
openProfileId Long 오픈 프로필 id
userId String 유저 id
nickname String 오픈 프로필 닉네임
imageUrl String 오픈 프로필 사진 S3 URL
description String 오픈 프로필 상태 메세지
createdDate LocalDateTime 오픈 프로필 생성된 날짜
updatedDate LocalDateTime 오픈 프로필 수정된 날짜

SUCCESS example

{
    "status": 201,
    "messsage": "오픈 프로필 생성 성공"
    "data": {
        "openProfileId": 1,
        "userId": "1643163512893324414",
        "nickname": "오픈 플레임",
        "imageUrl": "https://s3sopt25.s3.ap-northeast-2.amazonaws.com/1577892544930.png",
        "description": "업무 얘기만",
        "createdDate": "2022-01-14T10:52:39",
        "updatedDate": "2022-01-14T10:52:39"
    }
}

Error Code

Code Error Messsage
400 Bad Request
401 Unauthorized
500 Server Error

FAIL example

{
    "status": 400,
    "message": "기본 프로필은 하나만 생성 가능합니다",
    "error": "BAD_REQUEST",
    "code": "DEFAULT_PROFILE_EXIST",
    "timestamp": "2022-01-18T19:30:16.3072905",
}