HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🤎
프론트엔드 데브코스 5기 교육생
/
소인성팀
소인성팀
/
팀프로젝트-모모
팀프로젝트-모모
/
📃
API 명세서
📃

API 명세서

Models

User
{ "coverImage": String, // 커버 이미지 "image": String, // 프로필 이미지 "role": String, "emailVerified": Boolean, // 사용되지 않음 "banned": Boolean, // 사용되지 않음 "isOnline": Boolean, "posts": Post[], "likes": Like[], "comments": String[], "followers": [], "following": [ { "_id": "6169e91316cb2265df003c6d", "user": "6169e58216cb2265df003bf4", "follower": "6169e206aa57d952c6dc1edd", "createdAt": "2021-10-15T20:48:19.816Z", "updatedAt": "2021-10-15T20:48:19.816Z", "__v": 0 } ], "notifications": Notification[], "messages": Message[], "_id": String, "fullName": String, "email": String, "createdAt": String, "updatedAt": String }
Channel
{ "authRequired": Boolean, // 사용되지 않음 "posts": String[], "_id": String, "name": String, "description": String, "createdAt": String, "updatedAt": String }
Post
{ "likes": Like[], "comments": Comment[], "_id": String, "image": Optional<String>, "imagePublicId": Optional<String>, "title": String, "channel": Channel, "author": User, "createdAt": String, "updatedAt": String }
Like
{ "_id": String, "user": String, // 사용자 id "post": String, // 포스트 id "createdAt": String, "updatedAt": String }
Comment
{ "_id": String, "comment": String, "author": User, "post": String, // 포스트 id "createdAt": String, "updatedAt": String }
Notification
{ "seen": Boolean, "_id": String, "author": User, "user": User | String, "post": Nullable<String>, // 포스트 id "follow": Optional<String>, // 사용자 id "comment": Optional<Comment>, "message": Optional<String>, // 메시지 id "createdAt": String, "updatedAt": String }
Follow
{ "_id": String, "user": String, // 사용자 id "follower": String, // 사용자 id "createdAt": String, "updatedAt": String }
Conversation
{ "_id": String[], "message": String, "sender": User, "receiver": User, "seen": Boolean, "createdAt": String }
Message
{ "_id": String, "message": String, "sender": User, "receiver": User, "seen": Boolean, "createdAt": String, "updatedAt": String }

API docs

안내
오른쪽으로 스크롤해서 볼 수 있습니다 (전체화면 보기 설정 권한이 없네요…)
API Host는 https://kdt.frontend.5th.programmers.co.kr 입니다.
  • 주의할 점으로 API에 예외 처리가 안되어있는 경우가 있습니다. 이 경우 프론트엔드에서 Form Validation을 해주시면 됩니다.
  • Optional으로 적혀있는 경우 값을 넣지 않아도 동작하는 필드입니다.
  • Nullable으로 적혀있는 경우 null이 내려올 수 있는 필드입니다.
  • []는 리스트 타입입니다.
  • API URL에 중괄호로 감싸져 있는 부분은 Path Variable 입니다.
인증 여부
Function
Method
End Point
Request Params
Request Header
Request Body
Response Status
Response Body
비고
ㅤ
어드민 (채널 추가)
POST
/channels/create
ㅤ
ㅤ
{ "authRequired": Boolean // 채널 내용을 로그인한 사람만 볼 수 있는지 여부 "description": String // 채널 설명 "name": String // 채널 이름 }
200
ㅤ
email: admin@programmers.co.kr password: programmer
ㅤ
로그인
POST
/login
ㅤ
ㅤ
{ "email": String, "password": String }
200
{ "user": User, "token": String }
ㅤ
ㅤ
회원가입
POST
/signup
ㅤ
ㅤ
{ "email": String, "fullName": String, "password": String }
200
{ "user": User, "token": String }
ㅤ
Required
로그아웃
POST
/logout
ㅤ
Authorization: bearer JWT토큰
ㅤ
ㅤ
User
ㅤ
ㅤ
사용자 목록
GET
/users/get-users
offset: Optional limit: Optional
ㅤ
ㅤ
ㅤ
User[]
ㅤ
ㅤ
접속 중인 사용자 목록
GET
/users/online-users
ㅤ
ㅤ
ㅤ
ㅤ
User[]
ㅤ
ㅤ
사용자 정보
GET
/users/{userId}
ㅤ
ㅤ
ㅤ
ㅤ
User
ㅤ
Required
프로필 이미지 변경
POST
/users/upload-photo
ㅤ
Authorization: bearer JWT토큰
<FormData> { “isCover”: false, “image”: Binary }
ㅤ
User
isCover를 반드시 false로 넣어야 합니다.
Required
커버 이미지 변경
POST
/users/upload-photo
ㅤ
Authorization: bearer JWT토큰
<FormData> { “isCover”: true, “image”: Binary }
ㅤ
User
isCover를 반드시 true로 넣어야 합니다.
Required
내 정보 변경
PUT
/settings/update-user
ㅤ
Authorization: bearer JWT토큰
{ "fullName": String, "username": String }
ㅤ
User
ㅤ
Required
비밀번호 변경
PUT
/settings/update-password
ㅤ
Authorization: bearer JWT토큰
{ "password": String }
ㅤ
ㅤ
ㅤ
ㅤ
채널 목록
GET
/channels
ㅤ
ㅤ
ㅤ
ㅤ
Channel[]
ㅤ
ㅤ
채널 정보
GET
/channel/{channelName}
ㅤ
ㅤ
ㅤ
ㅤ
Channel
채널 이름이 한글일 때, 인코딩 필요
ㅤ
특정 채널의 포스트 목록
GET
/posts/channel/{channelId}
offset: Optional<Number> limit: Optional<Number>
ㅤ
ㅤ
ㅤ
Post[]
ㅤ
ㅤ
특정 사용자의 포스트 목록
GET
/posts/author/{authorId}
offset: Optional<Number> limit: Optional<Number>
ㅤ
ㅤ
ㅤ
Post[]
ㅤ
Required
특정 채널에 포스트 작성하기
POST
/posts/create
ㅤ
Authorization: bearer JWT토큰
<FormData> { “title”: String, “image”: Binary | null, “channelId”: String }
ㅤ
ㅤ
ㅤ
ㅤ
특정 포스트 상세 보기
GET
/posts/{postId}
ㅤ
ㅤ
ㅤ
ㅤ
Post
ㅤ
Required
내가 작성한 포스트 수정하기
PUT
/posts/update
ㅤ
Authorization: bearer JWT토큰
<FormData> { “postId”: String, “title”: String, “image”: Binary | null, “imageToDeletePublicId”: Optional, “channelId”: String }
ㅤ
ㅤ
이미지를 삭제하려면 imageToDeletePublicId에 imagePublicId를 넣어주세요.
Required
내가 작성한 포스트 삭제하기
DELETE
/posts/delete
ㅤ
Authorization: bearer JWT토큰
{ "id": String }
ㅤ
ㅤ
ㅤ
Required
특정 포스트 좋아요
POST
/likes/create
ㅤ
Authorization: bearer JWT토큰
{ "postId": String }
ㅤ
Like
ㅤ
Required
특정 포스트 좋아요 취소
DELETE
/likes/delete
ㅤ
Authorization: bearer JWT토큰
{ "id": String }
ㅤ
Like
ㅤ
Required
특정 포스트에 댓글 달기
POST
/comments/create
ㅤ
Authorization: bearer JWT토큰
{ "comment": String, "postId": String }
ㅤ
Comment
ㅤ
Required
특정 포스트에 작성한 내 댓글 지우기
DELETE
/comments/delete
ㅤ
Authorization: bearer JWT토큰
{ "id": String }
ㅤ
Comment
ㅤ
Required
나의 알림 목록
GET
/notifications
ㅤ
Authorization: bearer JWT토큰
ㅤ
ㅤ
Notification[]
ㅤ
Required
알림 확인 처리
PUT
/notifications/seen
ㅤ
Authorization: bearer JWT토큰
ㅤ
ㅤ
ㅤ
ㅤ
Required
알림 생성
POST
/notifications/create
ㅤ
Authorization: bearer JWT토큰
{ "notificationType": "COMMENT" | "FOLLOW" | "LIKE" | "MESSAGE", "notificationTypeId": String, "userId": String, "postId": Nullable<String> }
ㅤ
Notification
notificationTypeId는 type에 해당하는 객체의 id를 넣어주세요. - COMMENT일 경우엔 댓글 id - FOLLOW일 경우엔 팔로우 id - LIKE일 경우엔 좋아요 id - MESSAGE일 경우엔 메시지 id postId는 type이 FOLLOW일 경우엔 null로 보내주세요.
Required
특정유저 팔로우
POST
/follow/create
ㅤ
Authorization: bearer JWT토큰
{ "userId": String }
ㅤ
Follow
ㅤ
Required
특정 유저 언팔
DELETE
/follow/delete
ㅤ
Authorization: bearer JWT토큰
{ "id": String }
ㅤ
Follow
ㅤ
Required
나의 메시지함 (소통한 유저 목록)
GET
/messages/conversations
ㅤ
Authorization: bearer JWT토큰
ㅤ
ㅤ
Conversation[]
ㅤ
Required
특정 사용자와 소통한 메시지 목록
GET
/messages
userId: String
Authorization: bearer JWT토큰
ㅤ
ㅤ
Message[]
ㅤ
Required
특정 사용자에게 메시지 전송
POST
/messages/create
ㅤ
Authorization: bearer JWT토큰
{ "message": String, "receiver": String // 사용자 id }
ㅤ
Message
ㅤ
Required
메시지 확인 처리
PUT
/messages/update-seen
ㅤ
Authorization: bearer JWT토큰
{ "sender": String // 사용자 id }
ㅤ
ㅤ
ㅤ
ㅤ
사용자 검색
GET
/search/users/{keyword}
ㅤ
ㅤ
ㅤ
ㅤ
User[]
ㅤ
ㅤ
전체 검색 (포스트, 사용자)
GET
/search/all/{keyword}
ㅤ
ㅤ
ㅤ
ㅤ
(User | Post)[]
ㅤ
 
📜
프로그래머스 명세서